]> git.openstreetmap.org Git - rails.git/blobdiff - vendor/assets/ohauth/ohauth.js
Revert 39468944 and fix osmlab#91 without loosing the editor choice
[rails.git] / vendor / assets / ohauth / ohauth.js
index 210e859e4c57b0ce3412f3aba5dcfaa7b41afb61..73eb8b9eeec5756c63ce6701c7a893fbaab95d04 100644 (file)
@@ -16,7 +16,9 @@ ohauth.qsString = function(obj) {
 };
 
 ohauth.stringQs = function(str) {
-    return str.split('&').reduce(function(obj, pair){
+    return str.split('&').filter(function (pair) {
+        return pair !== '';
+    }).reduce(function(obj, pair){
         var parts = pair.split('=');
         obj[decodeURIComponent(parts[0])] = (null === parts[1]) ?
             '' : decodeURIComponent(parts[1]);