r79515 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79514‎ | r79515 | r79516 >
Date:18:15, 3 January 2011
Author:ialex
Status:ok
Tags:
Comment:
Just call loadPageData() if not already done to get the $mIsRedirect flag in Article::isRedirect() instead of doing a lot of useless stuff
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -667,18 +667,14 @@
668668 */
669669 public function isRedirect( $text = false ) {
670670 if ( $text === false ) {
671 - if ( $this->mDataLoaded ) {
672 - return $this->mIsRedirect;
 671+ if ( !$this->mDataLoaded ) {
 672+ $this->loadPageData();
673673 }
674674
675 - // Apparently loadPageData was never called
676 - $this->loadContent();
677 - $titleObj = Title::newFromRedirectRecurse( $this->fetchContent() );
 675+ return (bool)$this->mIsRedirect;
678676 } else {
679 - $titleObj = Title::newFromRedirect( $text );
 677+ return Title::newFromRedirect( $text ) !== null;
680678 }
681 -
682 - return $titleObj !== null;
683679 }
684680
685681 /**

Status & tagging log