From: daniel Date: Fri, 8 Jun 2012 10:10:40 +0000 (+0200) Subject: get rid of nonsensical $text parameter in WikiText::isRedirect() X-Git-Tag: 1.31.0-rc.0~22097^2^2~125 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/bilan.php?a=commitdiff_plain;h=b5cabf0f63a4fc2ec8ccdd95456dc9160d7ebc26;p=lhc%2Fweb%2Fwiklou.git get rid of nonsensical $text parameter in WikiText::isRedirect() --- diff --git a/includes/WikiFilePage.php b/includes/WikiFilePage.php index 3197b1dfc4..0114cce902 100644 --- a/includes/WikiFilePage.php +++ b/includes/WikiFilePage.php @@ -105,13 +105,12 @@ class WikiFilePage extends WikiPage { } /** - * @param bool $text * @return bool */ - public function isRedirect( $text = false ) { + public function isRedirect( ) { $this->loadFile(); if ( $this->mFile->isLocal() ) { - return parent::isRedirect( $text ); + return parent::isRedirect(); } return (bool)$this->mFile->getRedirected(); diff --git a/includes/WikiPage.php b/includes/WikiPage.php index df53ca7d47..7d183cf359 100644 --- a/includes/WikiPage.php +++ b/includes/WikiPage.php @@ -466,18 +466,15 @@ class WikiPage extends Page { } /** - * Tests if the article text represents a redirect + * Tests if the article content represents a redirect * - * @param $text mixed string containing article contents, or boolean * @return bool */ - public function isRedirect( $text = false ) { #TODO: investiage whether we need the text param - if ( $text === false ) $content = $this->getContent(); - else $content = ContentHandler::makeContent( $text, $this->mTitle ); # TODO: allow model and format to be provided; or better, expect a Content object - + public function isRedirect( ) { + $content = $this->getContent(); + if ( !$content ) return false; - if ( empty( $content ) ) return false; - else return $content->isRedirect(); + return $content->isRedirect(); } /**