merge latest master into Wikidata branch
[lhc/web/wiklou.git] / includes / OutputPage.php
index 981637c..a03282a 100644 (file)
@@ -255,7 +255,7 @@ class OutputPage extends ContextSource {
        function __construct( IContextSource $context = null ) {
                if ( $context === null ) {
                        # Extensions should use `new RequestContext` instead of `new OutputPage` now.
-                       wfDeprecated( __METHOD__ );
+                       wfDeprecated( __METHOD__, '1.18' );
                } else {
                        $this->setContext( $context );
                }
@@ -1902,7 +1902,7 @@ class OutputPage extends ContextSource {
         * @deprecated since 1.18 Use HttpStatus::getMessage() instead.
         */
        public static function getStatusMessage( $code ) {
-               wfDeprecated( __METHOD__ );
+               wfDeprecated( __METHOD__, '1.18' );
                return HttpStatus::getMessage( $code );
        }
 
@@ -1993,7 +1993,11 @@ class OutputPage extends ContextSource {
                wfRunHooks( 'AfterFinalPageOutput', array( $this ) );
 
                $this->sendCacheControl();
+
+               wfRunHooks( 'AfterFinalPageOutput', array( &$this ) );
+
                ob_end_flush();
+
                wfProfileOut( __METHOD__ );
        }
 
@@ -2459,7 +2463,7 @@ $templates
         */
        private function addDefaultModules() {
                global $wgIncludeLegacyJavaScript, $wgPreloadJavaScriptMwUtil, $wgUseAjax,
-                       $wgAjaxWatch, $wgEnableMWSuggest;
+                       $wgAjaxWatch;
 
                // Add base resources
                $this->addModules( array(
@@ -2487,8 +2491,8 @@ $templates
                                $this->addModules( 'mediawiki.page.watch.ajax' );
                        }
 
-                       if ( $wgEnableMWSuggest && !$this->getUser()->getOption( 'disablesuggest', false ) ) {
-                               $this->addModules( 'mediawiki.legacy.mwsuggest' );
+                       if ( !$this->getUser()->getOption( 'disablesuggest', false ) ) {
+                               $this->addModules( 'mediawiki.searchSuggest' );
                        }
                }
 
@@ -2912,7 +2916,7 @@ $templates
         * @return array
         */
        public function getJSVars() {
-               global $wgUseAjax, $wgEnableMWSuggest, $wgContLang;
+               global $wgUseAjax, $wgContLang;
 
                $latestRevID = 0;
                $pageID = 0;
@@ -2978,9 +2982,6 @@ $templates
                foreach ( $title->getRestrictionTypes() as $type ) {
                        $vars['wgRestriction' . ucfirst( $type )] = $title->getRestrictions( $type );
                }
-               if ( $wgUseAjax && $wgEnableMWSuggest && !$this->getUser()->getOption( 'disablesuggest', false ) ) {
-                       $vars['wgSearchNamespaces'] = SearchEngine::userNamespaces( $this->getUser() );
-               }
                if ( $title->isMainPage() ) {
                        $vars['wgIsMainPage'] = true;
                }