get rid of nonsensical $text parameter in WikiText::isRedirect()
authordaniel <daniel.kinzler@wikimedia.de>
Fri, 8 Jun 2012 10:10:40 +0000 (12:10 +0200)
committerdaniel <daniel.kinzler@wikimedia.de>
Fri, 8 Jun 2012 10:11:44 +0000 (12:11 +0200)
includes/WikiFilePage.php
includes/WikiPage.php

index 3197b1d..0114cce 100644 (file)
@@ -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();
index df53ca7..7d183cf 100644 (file)
@@ -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();
        }
 
        /**