From cf1da4c42dec5c3782d3059da34e5a4ef94ef0a5 Mon Sep 17 00:00:00 2001 From: Fabien Date: Mon, 21 Oct 2013 21:30:04 +0100 Subject: [PATCH 1/2] Fixing #890 - decodeURIComponent on search string. Invoking decodeURIComponent on search string, calls twice to capture %252C case's. --- public/js/editors/editors.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/js/editors/editors.js b/public/js/editors/editors.js index f8744c5d..775eb568 100644 --- a/public/js/editors/editors.js +++ b/public/js/editors/editors.js @@ -73,6 +73,10 @@ panels.restore = function () { // the panel name of 'output' and the shortcut 'live'. // it also strips out prop=value& to avoid bashing the // panel name + + // Calls decodeURIComponent twice to capture uses of %252C + search = decodeURIComponent(decodeURIComponent(search)); + toopen = (search || hash).replace(/\b([^&=]*)=([^&=]*)/g, '').replace(/&/g, '').split(','); if (toopen.indexOf('output') !== -1) { From a9abec83dacde336c330b30593d06f1d5ae562ba Mon Sep 17 00:00:00 2001 From: Fabien O'Carroll Date: Tue, 22 Oct 2013 11:15:26 +0100 Subject: [PATCH 2/2] Removing double call to decodeURIComponent Now invokes on `(search || hash`)` directly in the toopen assignment --- public/js/editors/editors.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/public/js/editors/editors.js b/public/js/editors/editors.js index 775eb568..30d49eb6 100644 --- a/public/js/editors/editors.js +++ b/public/js/editors/editors.js @@ -74,10 +74,7 @@ panels.restore = function () { // it also strips out prop=value& to avoid bashing the // panel name - // Calls decodeURIComponent twice to capture uses of %252C - search = decodeURIComponent(decodeURIComponent(search)); - - toopen = (search || hash).replace(/\b([^&=]*)=([^&=]*)/g, '').replace(/&/g, '').split(','); + toopen = decodeURIComponent(search || hash).replace(/\b([^&=]*)=([^&=]*)/g, '').replace(/&/g, '').split(','); if (toopen.indexOf('output') !== -1) { toopen.push('live');