Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Fixes a bug attaching beacon URL parameters #37

Merged
merged 3 commits into from about 2 years ago

3 participants

Edgar Klein Philip Tellis Marcel Duran
Edgar Klein

When attaching beacon URL parameters boomerang always starts attaching the parameters with "?". This is incorrect if the beacon URL already contains URL parameters. This fix checks whether the URL contains a "?" and if it does, it will attach the parameters prefixed with "&".

Edgar Klein and others added some commits
Philip Tellis

agreed, this should be merged in.

Philip Tellis bluesmoon commented on the diff
boomerang.js
@@ -373,8 +373,15 @@ boomr = {
373 373 return this;
374 374 }
375 375
  376 + // if there are already url parameters in the beacon url,
  377 + // change the first parameter prefix for the boomerang url parameters to &
  378 + var paramPrefix = '?';
1
Philip Tellis
bluesmoon added a note

Based on boomerang's coding convention, variables should be declared at the start of the function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Philip Tellis bluesmoon commented on the diff
boomerang.js
@@ -373,8 +373,15 @@ boomr = {
373 373 return this;
374 374 }
375 375
  376 + // if there are already url parameters in the beacon url,
  377 + // change the first parameter prefix for the boomerang url parameters to &
  378 + var paramPrefix = '?';
  379 + if(impl.beacon_url.indexOf('?') > -1)
1
Philip Tellis
bluesmoon added a note

Also, preferred braces around all block statements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Philip Tellis

merged into bluesmoon/master with a few mods, and have requested an upstream pull.

Edgar Klein

I hope you merged all 3 pull requests because they are all related.

Philip Tellis
Marcel Duran marcelduran merged commit 8dc71c5 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 3 unique commits by 2 authors.

Mar 23, 2012
Edgar Klein if there are already url parameters in the beacon url, change the fir…
…st parameter prefix for the boomerang url parameters to &
8eb0a56
Edgar Klein replaced spaces with tabs 2b3a576
Mar 26, 2012
Edgar Klein edgarklein added paramPrefix to be included into the url creation 8dc71c5
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 8 additions and 1 deletion. Show diff stats Hide diff stats

  1. +8 1 boomerang.js
9 boomerang.js
@@ -373,8 +373,15 @@ boomr = {
373 373 return this;
374 374 }
375 375
  376 + // if there are already url parameters in the beacon url,
  377 + // change the first parameter prefix for the boomerang url parameters to &
  378 + var paramPrefix = '?';
  379 + if(impl.beacon_url.indexOf('?') > -1)
  380 + paramPrefix = '&';
  381 +
  382 +
376 383 // use document.URL instead of location.href because of a safari bug
377   - url = impl.beacon_url + '?v=' + encodeURIComponent(BOOMR.version) +
  384 + url = impl.beacon_url + paramPrefix + 'v=' + encodeURIComponent(BOOMR.version) +
378 385 '&u=' + encodeURIComponent(d.URL.replace(/#.*/, ''));
379 386
380 387 for(k in impl.vars) {

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.