Jonas Kress (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/328492 )

Change subject: Avoid security exception for illegal localStorage access
......................................................................

Avoid security exception for illegal localStorage access

Change-Id: I5962ab9cc74dee56d641281dfa9250ad1e62dab6
---
M wikibase/queryService/ui/editor/Editor.js
1 file changed, 6 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikidata/query/gui 
refs/changes/92/328492/1

diff --git a/wikibase/queryService/ui/editor/Editor.js 
b/wikibase/queryService/ui/editor/Editor.js
index 59be04b..d198b35 100644
--- a/wikibase/queryService/ui/editor/Editor.js
+++ b/wikibase/queryService/ui/editor/Editor.js
@@ -3,8 +3,7 @@
 wikibase.queryService.ui = wikibase.queryService.ui || {};
 wikibase.queryService.ui.editor = wikibase.queryService.ui.editor || {};
 
-wikibase.queryService.ui.editor.Editor = ( function( $, wikibase, CodeMirror, 
WikibaseRDFTooltip,
-               localStorage ) {
+wikibase.queryService.ui.editor.Editor = ( function( $, wikibase, CodeMirror, 
WikibaseRDFTooltip, window ) {
        'use strict';
 
        var CODEMIRROR_DEFAULTS = {
@@ -241,8 +240,8 @@
         * @param {string} value
         */
        SELF.prototype.storeValue = function( value ) {
-               if ( localStorage ) {
-                       localStorage.setItem( LOCAL_STORAGE_KEY, value );
+               if ( window.localStorage ) {
+                       window.localStorage.setItem( LOCAL_STORAGE_KEY, value );
                }
        };
 
@@ -250,8 +249,8 @@
         * Restores the value from the local storage
         */
        SELF.prototype.restoreValue = function() {
-               if ( localStorage ) {
-                       var value = localStorage.getItem( LOCAL_STORAGE_KEY );
+               if ( window.localStorage ) {
+                       var value = window.localStorage.getItem( 
LOCAL_STORAGE_KEY );
                        if ( value ) {
                                this.setValue( value );
                                this.refresh();
@@ -271,4 +270,4 @@
 
        return SELF;
 
-}( jQuery, wikibase, CodeMirror, window.localStorage ) );
+}( jQuery, wikibase, CodeMirror, window ) );

-- 
To view, visit https://gerrit.wikimedia.org/r/328492
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5962ab9cc74dee56d641281dfa9250ad1e62dab6
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/gui
Gerrit-Branch: master
Gerrit-Owner: Jonas Kress (WMDE) <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to