[#CB-838] escape and encode data before saving, unescape + decode on retrieval
Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/commit/f666498b Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/f666498b Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/f666498b Branch: refs/heads/master Commit: f666498b0e90562d76450048401da8973fb5d70f Parents: 64fd520 Author: Jesse MacFadyen <[email protected]> Authored: Thu Jun 14 11:01:28 2012 -0700 Committer: Jesse MacFadyen <[email protected]> Committed: Thu Jun 14 11:01:28 2012 -0700 ---------------------------------------------------------------------- lib/wp7/plugin/wp7/DOMStorage.js | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/f666498b/lib/wp7/plugin/wp7/DOMStorage.js ---------------------------------------------------------------------- diff --git a/lib/wp7/plugin/wp7/DOMStorage.js b/lib/wp7/plugin/wp7/DOMStorage.js index 842902a..34f9b95 100644 --- a/lib/wp7/plugin/wp7/DOMStorage.js +++ b/lib/wp7/plugin/wp7/DOMStorage.js @@ -84,7 +84,7 @@ var retVal = null; if(this.keys.indexOf(key) > -1) { window.external.Notify("DOMStorage/" + this._type + "/get/" + key); - retVal = this._result; + retVal = unescape(decodeURIComponent(this._result)); this._result = null; } return retVal; @@ -101,7 +101,7 @@ if(!this.keys) { this.initialize(); } - window.external.Notify("DOMStorage/" + this._type + "/set/" + key + "/" + value); + window.external.Notify("DOMStorage/" + this._type + "/set/" + key + "/" + encodeURIComponent(escape(value))); }, /*
