$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;
}
* 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" );
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.
$this->setHeaders();
$this->outputHeader();
- $this->allowClickjacking();
+ $out->allowClickjacking();
# GET values
$from = $request->getVal( 'from', null );
$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 );