diff options
author | isaacs <i@izs.me> | 2012-02-06 15:43:21 -0800 |
---|---|---|
committer | isaacs <i@izs.me> | 2012-02-06 15:43:21 -0800 |
commit | 116835561d118a19ab5b65644d83b7a054797ca9 (patch) | |
tree | a92e5e29bf271d43612389b004978f44ae2bd4ad /lib/querystring.js | |
parent | e5db01ee29e8b25545c6558b8c1b8f8b8461294c (diff) | |
parent | 7543c38dca2b4c64711f5667b82d80ffab3fd6a2 (diff) | |
download | android-node-v8-116835561d118a19ab5b65644d83b7a054797ca9.tar.gz android-node-v8-116835561d118a19ab5b65644d83b7a054797ca9.tar.bz2 android-node-v8-116835561d118a19ab5b65644d83b7a054797ca9.zip |
Merge remote-tracking branch 'ry/v0.6'
Conflicts:
ChangeLog
deps/v8/src/version.cc
deps/v8/tools/gyp/v8.gyp
doc/about/index.html
doc/community/index.html
doc/index.html
doc/logos/index.html
doc/template.html
lib/path.js
lib/querystring.js
src/node_version.h
Diffstat (limited to 'lib/querystring.js')
-rw-r--r-- | lib/querystring.js | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/querystring.js b/lib/querystring.js index 47e259a320..467eabdea7 100644 --- a/lib/querystring.js +++ b/lib/querystring.js @@ -183,9 +183,17 @@ QueryString.parse = QueryString.decode = function(qs, sep, eq, options) { } qs.forEach(function(kvp) { - var x = kvp.split(eq); - var k = QueryString.unescape(x[0], true); - var v = QueryString.unescape(x.slice(1).join(eq), true); + var x = kvp.split(eq), k, v, useQS = false; + try { + if (kvp.match(/\+/)) { // decodeURIComponent does not decode + to space + throw 'has +'; + } + k = decodeURIComponent(x[0]); + v = decodeURIComponent(x.slice(1).join(eq) || ""); + } catch(e) { + k = QueryString.unescape(x[0], true); + v = QueryString.unescape(x.slice(1).join(eq), true); + } if (!hasOwnProperty(obj, k)) { obj[k] = v; |