GWicke has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/68606


Change subject: Freeze some static values in WikiConfig
......................................................................

Freeze some static values in WikiConfig

Any changes to these would be bugs, and could lead to weird effects like
loading templates from another wiki.

Makes sure any attempt to modify the default values fails by freezing those
values.

Change-Id: Id198fcd285b179d9efa3698affe7e97bff95900b
---
M js/lib/mediawiki.WikiConfig.js
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Parsoid 
refs/changes/06/68606/1

diff --git a/js/lib/mediawiki.WikiConfig.js b/js/lib/mediawiki.WikiConfig.js
index 012ec69..3cc84e5 100644
--- a/js/lib/mediawiki.WikiConfig.js
+++ b/js/lib/mediawiki.WikiConfig.js
@@ -6,6 +6,9 @@
        Util = require( './mediawiki.Util.js' ).Util,
        request = require( 'request' );
 
+// Make sure our base config is never modified
+Util.deepFreeze(baseConfig);
+
 // escape 'special' characters in a regexp, returning a regexp which matches
 // the string exactly
 var re_escape = function(s) {
@@ -504,7 +507,8 @@
                delete this.extensionTags[tagName];
        }
 };
-Object.freeze(WikiConfig.prototype.canonicalNamespaces);
+// Make sure the prototype is never modified
+Util.deepFreeze(WikiConfig.prototype);
 
 if ( typeof module === 'object' ) {
        module.exports.WikiConfig = WikiConfig;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id198fcd285b179d9efa3698affe7e97bff95900b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: GWicke <[email protected]>

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

Reply via email to