mirror of
https://github.com/wassname/Mostly-Harmless.git
synced 2026-07-08 00:10:18 +08:00
Using encodeURIComponent escapes the URL properly to be passed as a Query String value.
Thanks, octatone!
This commit is contained in:
+1
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user