Merge "EditPage: Fix duplicate classic toolbar"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 24 May 2018 23:08:23 +0000 (23:08 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 24 May 2018 23:08:23 +0000 (23:08 +0000)
includes/EditPage.php

index 67ce1f3..87fb711 100644 (file)
@@ -4111,14 +4111,12 @@ ERROR;
 
                $script .= '});';
 
-               $nonce = $wgOut->getCSPNonce();
-               $wgOut->addScript( ResourceLoader::makeInlineScript( $script, $nonce ) );
-
                $toolbar = '<div id="toolbar"></div>';
 
                if ( Hooks::run( 'EditPageBeforeEditToolbar', [ &$toolbar ] ) ) {
                        // Only add the old toolbar cruft to the page payload if the toolbar has not
                        // been over-written by a hook caller
+                       $nonce = $wgOut->getCSPNonce();
                        $wgOut->addScript( ResourceLoader::makeInlineScript( $script, $nonce ) );
                };