Commits

David Chambers  committed ef5efd4

Prevented unencoded plus signs from appearing in URLs sent to bit.ly, which
treats pluses as encoded spaces.

  • Participants
  • Parent commits 36d8058

Comments (0)

Files changed (1)

   // EVENT HANDLERS //
 
   shorten.onclick = function (event) {
-    var hash = documentHash();
+    var hash = documentHash().replace(/[+]/g, '%2B');
     if (hash.length <= maxHashLength) {
       sendRequest(
         'shorten',
           // If `lastChar` is the first half of a surrogate pair, drop it
           // from the chunk and queue it for inclusion in the next chunk.
           /[\uD800-\uDBFF]/.test(lastChar) && queueChar();
-          return encode(chunk);
+          return encode(chunk).replace(/[+]/g, '%2B');
         }
 
         while (value.length) {