aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/js/js.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/core/js/js.js b/core/js/js.js
index 7d967321d93..5a24ba19c0c 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -343,8 +343,15 @@ if(typeof localStorage !=='undefined' && localStorage !== null){
return localStorage.setItem(OC.localStorage.namespace+name,JSON.stringify(item));
},
getItem:function(name){
- if(localStorage.getItem(OC.localStorage.namespace+name)===null){return null;}
- return JSON.parse(localStorage.getItem(OC.localStorage.namespace+name));
+ var item = localStorage.getItem(OC.localStorage.namespace+name);
+ if(item===null) {
+ return null;
+ } else if (typeof JSON === 'undefined') {
+ //fallback to jquery for IE6/7/8
+ return $.parseJSON(item);
+ } else {
+ return JSON.parse(item);
+ }
}
};
}else{