|
|
@ -352,7 +352,7 @@ $.api = $.fn.api = function(parameters) { |
|
|
|
} |
|
|
|
else { |
|
|
|
module.verbose('Found required variable', variable, value); |
|
|
|
url = url.replace(templatedString, value); |
|
|
|
url = url.replace(templatedString, module.get.urlEncodedValue(value)); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
@ -686,6 +686,19 @@ $.api = $.fn.api = function(parameters) { |
|
|
|
: settings |
|
|
|
; |
|
|
|
}, |
|
|
|
urlEncodedValue: function(value) { |
|
|
|
var |
|
|
|
decodedValue = window.decodeURIComponent(value), |
|
|
|
encodedValue = window.encodeURIComponent(value), |
|
|
|
alreadyEncoded = (decodedValue !== value) |
|
|
|
; |
|
|
|
if(alreadyEncoded) { |
|
|
|
module.debug('URL value is already encoded, avoiding double encoding', value); |
|
|
|
return value; |
|
|
|
} |
|
|
|
module.verbose('Encoding value for url', value, encodedValue); |
|
|
|
return encodedValue; |
|
|
|
}, |
|
|
|
defaultData: function() { |
|
|
|
var |
|
|
|
data = {} |
|
|
|