summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2015-02-06 09:27:44 +0100
committerAleksander Machniak <alec@alec.pl>2015-02-06 09:27:44 +0100
commit56040b941c20d1d2ed2abf3f1993ea550bc13086 (patch)
treeb848c317b91d9e297897d6c8072e4467bc5985e8
parent0b9b9f63b585ee3d6190342a993eb49d2b772dc4 (diff)
Fix so JSON.parse() errors on localStorage items are ignored (#1490249)
-rw-r--r--CHANGELOG1
-rw-r--r--program/js/app.js5
2 files changed, 4 insertions, 2 deletions
diff --git a/CHANGELOG b/CHANGELOG
index b77215c86..2df3bf6d9 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -20,6 +20,7 @@ CHANGELOG Roundcube Webmail
- Fix bug where signature could have been inserted twice after plain-to-html switch (#1490239)
- Fix security issue in DBMail driver of password plugin (#1490261)
- Enable FollowSymLinks option in .htaccess file which is required by rewrite rules (#1490255)
+- Fix so JSON.parse() errors on localStorage items are ignored (#1490249)
RELEASE 1.1-rc
--------------
diff --git a/program/js/app.js b/program/js/app.js
index 55a479956..227ba3275 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -8159,15 +8159,16 @@ function rcube_webmail()
// wrapper for localStorage.getItem(key)
this.local_storage_get_item = function(key, deflt, encrypted)
{
- var item;
+ var item, result;
// TODO: add encryption
try {
item = localStorage.getItem(this.get_local_storage_prefix() + key);
+ result = JSON.parse(item);
}
catch (e) { }
- return item !== null ? JSON.parse(item) : (deflt || null);
+ return result || deflt || null;
};
// wrapper for localStorage.setItem(key, data)