From d2fa85f5ae1a4f77d2d39d4fd96af79edf5db9e2 Mon Sep 17 00:00:00 2001 From: Kerrick Long Date: Tue, 28 Jun 2011 17:12:25 -0500 Subject: [PATCH] Using encodeURIComponent escapes the URL properly to be passed as a Query String value. Thanks, octatone! --- js/common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/common.js b/js/common.js index 0468e28..40a81ff 100644 --- a/js/common.js +++ b/js/common.js @@ -240,7 +240,7 @@ RedditAPI.prototype.getInfo = function (url) { matches = url.match(this.commentsMatchPattern); reqUrl = 'http://' + this.domain + '/by_id/t3_' + matches[3] + '.json'; } else { - reqUrl = 'http://' + this.domain + '/api/info.json?url=' + encodeURI(url); + reqUrl = 'http://' + this.domain + '/api/info.json?url=' + encodeURIComponent(url); } response = this.apiTransmit('GET', reqUrl, false);