Followup r85227; Back out changes related to avoiding calls to OutputPage from includ...
authorDaniel Friesen <dantman@users.mediawiki.org>
Sun, 3 Apr 2011 06:26:58 +0000 (06:26 +0000)
committerDaniel Friesen <dantman@users.mediawiki.org>
Sun, 3 Apr 2011 06:26:58 +0000 (06:26 +0000)
includes/SpecialPage.php
includes/specials/SpecialAllpages.php

index 10a016b..6bd224e 100644 (file)
@@ -547,12 +547,10 @@ class SpecialPage {
                $page = SpecialPage::getPageByAlias( $name );
                # Nonexistent?
                if ( !$page ) {
-                       if ( !$including ) {
-                               $wgOut->setArticleRelated( false );
-                               $wgOut->setRobotPolicy( 'noindex,nofollow' );
-                               $wgOut->setStatusCode( 404 );
-                               $wgOut->showErrorPage( 'nosuchspecialpage', 'nospecialpagetext' );
-                       }
+                       $wgOut->setArticleRelated( false );
+                       $wgOut->setRobotPolicy( 'noindex,nofollow' );
+                       $wgOut->setStatusCode( 404 );
+                       $wgOut->showErrorPage( 'nosuchspecialpage', 'nospecialpagetext' );
                        wfProfileOut( __METHOD__ );
                        return false;
                }
@@ -877,10 +875,6 @@ class SpecialPage {
         * Sets headers - this should be called from the execute() method of all derived classes!
         */
        function setHeaders() {
-               if ( $this->including() ) {
-                       // Don't set these headers when special page is being included into an article
-                       return;
-               }
                $out = $this->getOutput();
                $out->setArticleRelated( false );
                $out->setRobotPolicy( "noindex,nofollow" );
@@ -1054,16 +1048,6 @@ class SpecialPage {
                return $this->getOutput()->getSkin();
        }
 
-       /**
-        * Shortcut to call OutputPage::allowClickjacking(); which also takes
-        * transclusion into account.
-        */
-       public function allowClickjacking() {
-               if ( !$this->including() ) {
-                       $this->getOutput()->allowClickjacking();
-               }
-       }
-
        /**
         * Wrapper around wfMessage that sets the current context. Currently this
         * is only the title.
index bb4c1d7..ec049ac 100644 (file)
@@ -64,7 +64,7 @@ class SpecialAllpages extends IncludableSpecialPage {
 
                $this->setHeaders();
                $this->outputHeader();
-               $this->allowClickjacking();
+               $out->allowClickjacking();
 
                # GET values
                $from = $request->getVal( 'from', null );
@@ -73,17 +73,12 @@ class SpecialAllpages extends IncludableSpecialPage {
 
                $namespaces = $wgContLang->getNamespaces();
 
-               if( !$this->including() ) {
-                       $out->setPagetitle(
-                               ( $namespace > 0 && in_array( $namespace, array_keys( $namespaces) ) ) ?
-                               wfMsg( 'allinnamespace', str_replace( '_', ' ', $namespaces[$namespace] ) ) :
-                               wfMsg( 'allarticles' )
-                       );
-                       // Note: The following will not end up in the parser output cache as
-                       // a result even if we wanted to load it on pages including the
-                       // special page it would be unstable.
-                       $out->addModuleStyles( 'mediawiki.special' );
-               }
+               $out->setPagetitle(
+                       ( $namespace > 0 && in_array( $namespace, array_keys( $namespaces) ) ) ?
+                       wfMsg( 'allinnamespace', str_replace( '_', ' ', $namespaces[$namespace] ) ) :
+                       wfMsg( 'allarticles' )
+               );
+               $out->addModuleStyles( 'mediawiki.special' );
 
                if( isset($par) ) {
                        $this->showChunk( $namespace, $par, $to );