diff options
Diffstat (limited to 'lib/querystring.js')
-rw-r--r-- | lib/querystring.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/querystring.js b/lib/querystring.js index ad1b5861a0..bacfc4bd70 100644 --- a/lib/querystring.js +++ b/lib/querystring.js @@ -90,8 +90,12 @@ for (var i = 0; i < 256; ++i) QueryString.escape = function(str) { // replaces encodeURIComponent // http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3.4 - if (typeof str !== 'string') - str += ''; + if (typeof str !== 'string') { + if (typeof str === 'object') + str = String(str); + else + str += ''; + } var out = ''; var lastPos = 0; |