var $mUser; //!<
var $mUserText; //!<
var $mRedirectTarget; //!<
+ var $mIsRedirect;
/**@}}*/
/**
*/
function isRedirect( $text = false ) {
if ( $text === false ) {
+ if ( $this->mDataLoaded )
+ return $this->mIsRedirect;
+
+ // Apparently loadPageData was never called
$this->loadContent();
$titleObj = Title::newFromRedirect( $this->fetchContent() );
} else {
$from = $this->img->getRedirected();
return Title::makeTitle( NS_IMAGE, $from );
}
+ public function isRedirect() {
+ if ( $this->img->isLocal() )
+ return parent::isRedirect();
+
+ return (bool)$this->img->getRedirected();
+ }
/**
* Create the TOC
$article->loadPageData( $article->pageDataFromTitle( $dbr, $title ) );
// Follow redirects only for... redirects
- if( $article->mIsRedirect ) {
+ if( $article->isRedirect() ) {
$target = $article->followRedirect();
if( is_string( $target ) ) {
if( !$this->getVal( 'DisableHardRedirects' ) ) {
// Rewrite environment to redirected article
$rarticle = self::articleFromTitle( $target );
$rarticle->loadPageData( $rarticle->pageDataFromTitle( $dbr, $target ) );
- if ( $rarticle->mTitle->exists() ) {
+ if ( $rarticle->getTitle()->exists() ) {
$rarticle->setRedirectedFrom( $title );
$article = $rarticle;
$title = $target;
}
}
} else {
- $title = $article->mTitle;
+ $title = $article->getTitle();
}
}
wfProfileOut( __METHOD__ );