Skip to content

Commit 6b0a317

Browse files
committed
Fixing this to that reference in http_build_query()
1 parent 153812c commit 6b0a317

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

functions/url/http_build_query.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ function http_build_query (formdata, numeric_prefix, arg_separator) {
66
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
77
// + improved by: Brett Zamir (http://brett-zamir.me)
88
// + revised by: stag019
9+
// + input by: Dreamer
10+
// + bugfixed by: Brett Zamir (http://brett-zamir.me)
911
// - depends on: urlencode
1012
// * example 1: http_build_query({foo: 'bar', php: 'hypertext processor', baz: 'boom', cow: 'milk'}, '', '&');
1113
// * returns 1: 'foo=bar&php=hypertext+processor&baz=boom&cow=milk'
1214
// * example 2: http_build_query({'php': 'hypertext processor', 0: 'foo', 1: 'bar', 2: 'baz', 3: 'boom', 'cow': 'milk'}, 'myvar_');
1315
// * returns 2: 'php=hypertext+processor&myvar_0=foo&myvar_1=bar&myvar_2=baz&myvar_3=boom&cow=milk'
1416

15-
var value, key, tmp = [];
17+
var value, key, tmp = [], that = this;
1618

1719
var _http_build_query_helper = function (key, val, arg_separator) {
1820
var k, tmp = [];
@@ -29,7 +31,7 @@ function http_build_query (formdata, numeric_prefix, arg_separator) {
2931
}
3032
return tmp.join(arg_separator);
3133
} else if (typeof(val) !== "function") {
32-
return this.urlencode(key) + "=" + this.urlencode(val);
34+
return that.urlencode(key) + "=" + that.urlencode(val);
3335
} else {
3436
throw new Error('There was an error processing for http_build_query().');
3537
}

0 commit comments

Comments
 (0)