From da088f38ad26438d1e3563157c3659f251c4ebee Mon Sep 17 00:00:00 2001 From: daniel Date: Fri, 8 Jun 2012 12:10:40 +0200 Subject: [PATCH] get rid of nonsensical $text parameter in WikiText::isRedirect() --- includes/WikiFilePage.php | 5 ++--- includes/WikiPage.php | 13 +++++-------- 2 files changed, 7 insertions(+), 11 deletions(-) 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(); } /** -- 2.20.1