$this->mRedirect = str_replace( "\n", '', $url );
$this->mRedirectCode = $responsecode;
}
+
+ public function getRedirect() {
+ return $this->mRedirect;
+ }
/**
* Set the HTTP status code to send with the output.
wfIncrStats('pcache_not_possible');
$popts = $this->parserOptions();
- $popts->setTidy($tidy);
+ $oldTidy = $popts->setTidy($tidy);
$parserOutput = $wgParser->parse( $text, $title, $popts,
$linestart, true, $this->mRevisionId );
+
+ $popts->setTidy( $oldTidy );
$this->addParserOutput( $parserOutput );
$name = User::whoIs( $wgUser->blockedBy() );
$reason = $wgUser->blockedFor();
+ if( $reason == '' ) {
+ $reason = wfMsg( 'blockednoreason' );
+ }
$blockTimestamp = $wgLang->timeanddate( wfTimestamp( TS_MW, $wgUser->mBlock->mTimestamp ), true );
$ip = wfGetIP();
$this->enableClientCache( false );
$this->mRedirect = '';
$this->mBodytext = '';
- $this->addHTML( $this->formatPermissionsErrorMessage( $errors ) );
+ $this->addWikiText( $this->formatPermissionsErrorMessage( $errors ) );
}
/** @deprecated */
default:
$message = wfMsgHtml( 'badaccess-groups', $groups );
}
- #$this->addHtml( $message );
+ $this->addHtml( $message );
$this->returnToMain( false );
}
$this->setPageTitle( wfMsg( 'viewsource' ) );
$this->setSubtitle( wfMsg( 'viewsourcefor', $skin->makeKnownLinkObj( $wgTitle ) ) );
- $this->addHTML( $this->formatPermissionsErrorMessage( $reasons ) );
+ $this->addWikiText( $this->formatPermissionsErrorMessage( $reasons ) );
} else if( $protected ) {
$this->setPageTitle( wfMsg( 'viewsource' ) );
$this->setSubtitle( wfMsg( 'viewsourcefor', $skin->makeKnownLinkObj( $wgTitle ) ) );
$titles = '';
foreach( $cascadeSources as $title )
$titles .= "* [[:" . $title->getPrefixedText() . "]]\n";
- $this->addWikiText( wfMsgExt( 'cascadeprotected', 'parsemag', $count ) . "\n{$titles}" );
+ $this->addWikiText( wfMsgExt( 'cascadeprotected', 'parsemag', $count, "\n{$titles}" ) );
} elseif( !$wgTitle->isProtected( 'edit' ) && $wgTitle->isNamespaceProtected() ) {
// Namespace protection
$ns = $wgTitle->getNamespace() == NS_MAIN
$article = new Article( $wgTitle );
$this->addHTML( $skin->formatTemplates( $article->getUsedTemplates() ) );
- $this->returnToMain( false );
+ $this->returnToMain( false, $wgTitle );
}
/** @deprecated */
}
$ret .= " />\n";
}
+
if( $this->isSyndicated() ) {
# FIXME: centralize the mime-type and name information in Feed.php
- $link = $wgRequest->escapeAppendQuery( 'feed=rss' );
- $ret .= "<link rel='alternate' type='application/rss+xml' title='RSS 2.0' href='$link' />\n";
- $link = $wgRequest->escapeAppendQuery( 'feed=atom' );
- $ret .= "<link rel='alternate' type='application/atom+xml' title='Atom 1.0' href='$link' />\n";
+ # Use the page name for the title (accessed through $wgTitle since
+ # there's no other way). In principle, this could lead to issues
+ # with having the same name for different feeds corresponding to
+ # the same page, but we can't avoid that at this low a level.
+ global $wgTitle;
+ $ret .= $this->feedLink(
+ 'rss',
+ $wgRequest->appendQuery( 'feed=rss' ),
+ wfMsg( 'page-rss-feed', $wgTitle->getPrefixedText() ) );
+ $ret .= $this->feedLink(
+ 'atom',
+ $wgRequest->appendQuery( 'feed=atom' ),
+ wfMsg( 'page-atom-feed', $wgTitle->getPrefixedText() ) );
}
+ # Recent changes feed should appear on every page
+ # Put it after the per-page feed to avoid changing existing behavior.
+ # It's still available, probably via a menu in your browser.
+ global $wgSitename;
+ $rctitle = SpecialPage::getTitleFor( 'Recentchanges' );
+ $ret .= $this->feedLink(
+ 'rss',
+ $rctitle->getFullURL( 'feed=rss' ),
+ wfMsg( 'site-rss-feed', $wgSitename ) );
+ $ret .= $this->feedLink(
+ 'atom',
+ $rctitle->getFullURL( 'feed=atom' ),
+ wfMsg( 'site-atom-feed', $wgSitename ) );
+
return $ret;
}
+
+ /**
+ * Generate a <link rel/> for an RSS feed.
+ */
+ private function feedLink( $type, $url, $text ) {
+ return Xml::element( 'link', array(
+ 'rel' => 'alternate',
+ 'type' => "application/$type+xml",
+ 'title' => $text,
+ 'href' => $url ) ) . "\n";
+ }
/**
* Turn off regular page output and return an error reponse