Merge "Migrate redirectToFragment() from wikibits.js to own module"
[lhc/web/wiklou.git] / includes / Article.php
index c82b39f..42ed58f 100644 (file)
@@ -989,9 +989,8 @@ class Article implements Page {
 
                                // Set the fragment if one was specified in the redirect
                                if ( strval( $this->getTitle()->getFragment() ) != '' ) {
-                                       $outputPage->addInlineScript( Xml::encodeJsCall(
-                                               'redirectToFragment', array( $this->getTitle()->getFragmentForURL() )
-                                       ) );
+                                       $outputPage->addJsConfigVars( 'wgRedirectToFragment', $this->getTitle()->getFragmentForURL() );
+                                       $outputPage->addModules( 'mediawiki.action.view.redirectToFragment' );
                                }
 
                                // Add a <link rel="canonical"> tag