http://www.mediawiki.org/wiki/Special:Code/MediaWiki/72223
Revision: 72223
Author: tparscal
Date: 2010-09-02 20:17:01 +0000 (Thu, 02 Sep 2010)
Log Message:
-----------
Wrapped inline generated scripts (which are evil) in code that prevents them
from being run if mediaWiki doesn't exist.
Modified Paths:
--------------
branches/resourceloader/phase3/includes/EditPage.php
branches/resourceloader/phase3/includes/ProtectionForm.php
Modified: branches/resourceloader/phase3/includes/EditPage.php
===================================================================
--- branches/resourceloader/phase3/includes/EditPage.php 2010-09-02
20:11:01 UTC (rev 72222)
+++ branches/resourceloader/phase3/includes/EditPage.php 2010-09-02
20:17:01 UTC (rev 72223)
@@ -2246,9 +2246,9 @@
}
$wgOut->addScript( Html::inlineScript(
- "\nmediaWiki.loader.using( 'mediawiki.legacy.edit',
function() { $script } );\n"
+ "if ( mediaWiki !== undefined ) {
mediaWiki.loader.using( 'mediawiki.legacy.edit', function() { $script } ); }"
) );
-
+
$toolbar .= "\n</div>";
wfRunHooks( 'EditPageBeforeEditToolbar', array( &$toolbar ) );
Modified: branches/resourceloader/phase3/includes/ProtectionForm.php
===================================================================
--- branches/resourceloader/phase3/includes/ProtectionForm.php 2010-09-02
20:11:01 UTC (rev 72222)
+++ branches/resourceloader/phase3/includes/ProtectionForm.php 2010-09-02
20:17:01 UTC (rev 72223)
@@ -592,7 +592,7 @@
$encOptions = Xml::encodeJsVar( $options );
$script .= "ProtectionForm.init($encOptions)";
- return Html::inlineScript( "mediaWiki.loader.using(
'mediawiki.legacy.protect', function() { {$script} } );" );
+ return Html::inlineScript( "if ( mediaWiki !== undefined ) {
mediaWiki.loader.using( 'mediawiki.legacy.protect', function() { {$script} } );
}" );
}
/**
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs