From 08cc2834df1a6542dd05e3039bb19fb2a50da109 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Fri, 24 Feb 2012 00:01:43 +0100 Subject: [PATCH] Adds en- and decoding for URL hashes. --- src/_h5ai/js/inc/Core.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/_h5ai/js/inc/Core.js b/src/_h5ai/js/inc/Core.js index a692fc3b..ea259088 100644 --- a/src/_h5ai/js/inc/Core.js +++ b/src/_h5ai/js/inc/Core.js @@ -50,7 +50,7 @@ var hashStr = ''; $.each($.extend({}, hash(), obj), function (key, value) { if (value) { - hashStr += '/' + key + '=' + value; + hashStr += '/' + encodeURIComponent(key) + '=' + encodeURIComponent(value); } }); hashStr = '#!' + hashStr; @@ -66,7 +66,7 @@ var match = /^([^=]*)=(.*?)$/.exec(part); if (match) { - result[match[1]] = match[2]; + result[decodeURIComponent(match[1])] = decodeURIComponent(match[2]); } }); }