EditPage: Fix duplicate classic toolbar
authorBartosz Dziewoński <matma.rex@gmail.com>
Thu, 24 May 2018 22:54:14 +0000 (00:54 +0200)
committerBartosz Dziewoński <matma.rex@gmail.com>
Thu, 24 May 2018 22:54:14 +0000 (00:54 +0200)
Caused by an incorrectly resolved rebase conflict
between 14cffee7c1ea7e6f411730a52aadb2458fcfb0fd
and 70941efd35562dcb7003229b56c91a98a67de7a9.

Bug: T195517
Change-Id: I294acff48fe9b1a1a9384d717f09d90e417204ab

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 ) );
                };