From 41c5f675cf463e7e782f4f9aa7df3b7a0d6f4b5d Mon Sep 17 00:00:00 2001 From: Laurent Monin Date: Fri, 5 Jun 2015 16:53:15 +0200 Subject: [PATCH] Encode URI passed as parameter in MB ws request url --- lib/mblinks.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/mblinks.js b/lib/mblinks.js index 34fbb9b..ccb2e30 100644 --- a/lib/mblinks.js +++ b/lib/mblinks.js @@ -84,8 +84,8 @@ var MBLinks = function (cachekey, expiration) { } else { mblinks.ajax_requests.push($.proxy(function () { var context = this; - $.getJSON('//musicbrainz.org/ws/2/url?resource=' + context.url + '&inc=' + context.mb_type + - '-rels', + $.getJSON('//musicbrainz.org/ws/2/url?resource=' + encodeURIComponent(context.url) + + '&inc=' + context.mb_type + '-rels', function (data) { if ('relations' in data) { var expires = new Date().getTime() + (mblinks.expirationMinutes * 60 * 1000);