From: Aaron Schulz Date: Thu, 1 Oct 2015 10:32:01 +0000 (-0700) Subject: Made WikiPage::isRedirect() actually use page_is_redirect X-Git-Tag: 1.31.0-rc.0~9608^2 X-Git-Url: https://git.cyclocoop.org/%27.%24link.%27?a=commitdiff_plain;h=7d4a930c95cce41cdea2774375ee7f5aa6a99623;p=lhc%2Fweb%2Fwiklou.git Made WikiPage::isRedirect() actually use page_is_redirect * Previously it would always fetch the whole content, which is silly since followRedirect() uses the redirect table to avoid loading the text. The initializeArticle() uses isRedirect() and then possibly followRedirect(). It makes no sense for the former to fetch all the text anway. * The time fetching the text showed up on xenon flamegraphs. Change-Id: I2dc216f36d3a0ea2285e64122b4d07bd9c8ae703 --- diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index 708a8755e5..d3978eac7f 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -469,12 +469,11 @@ class WikiPage implements Page, IDBAccessObject { * @return bool */ public function isRedirect() { - $content = $this->getContent(); - if ( !$content ) { - return false; + if ( !$this->mDataLoaded ) { + $this->loadPageData(); } - return $content->isRedirect(); + return (bool)$this->mIsRedirect; } /**