Merge "Add support for 'hu-formal'"
[lhc/web/wiklou.git] / includes / specials / SpecialRecentchangeslinked.php
index 2eeeb0b..181b4db 100644 (file)
@@ -30,8 +30,6 @@ class SpecialRecentChangesLinked extends SpecialRecentChanges {
        /** @var bool|Title */
        protected $rclTargetTitle;
 
-       protected $rclTarget;
-
        function __construct() {
                parent::__construct( 'Recentchangeslinked' );
        }
@@ -46,7 +44,6 @@ class SpecialRecentChangesLinked extends SpecialRecentChanges {
 
        public function parseParameters( $par, FormOptions $opts ) {
                $opts['target'] = $par;
-               $this->rclTarget = $par;
        }
 
        /**
@@ -68,7 +65,6 @@ class SpecialRecentChangesLinked extends SpecialRecentChanges {
                        $outputPage->addHTML(
                                Html::errorBox( $this->msg( 'allpagesbadtitle' )->parse() )
                        );
-
                        return false;
                }
 
@@ -297,17 +293,22 @@ class SpecialRecentChangesLinked extends SpecialRecentChanges {
                return $this->prefixSearchString( $search, $limit, $offset );
        }
 
-       /**
-        * Get a self-referential title object
-        * with consideration to the given subpage.
-        *
-        * @param string|bool $subpage
-        * @return Title
-        * @since 1.23
-        */
-       public function getPageTitle( $subpage = false ) {
-               $subpage = $subpage ? $subpage : $this->rclTarget;
-
-               return parent::getPageTitle( $subpage );
+       protected function outputNoResults() {
+               $targetTitle = $this->getTargetTitle();
+               if ( $targetTitle === false ) {
+                       $this->getOutput()->addHTML(
+                               '<div class="mw-changeslist-empty mw-changeslist-notargetpage">' .
+                               $this->msg( 'recentchanges-notargetpage' )->parse() .
+                               '</div>'
+                       );
+               } elseif ( !$targetTitle || $targetTitle->isExternal() ) {
+                       $this->getOutput()->addHTML(
+                               '<div class="mw-changeslist-empty mw-changeslist-invalidtargetpage">' .
+                               $this->msg( 'allpagesbadtitle' )->parse() .
+                               '</div>'
+                       );
+               } else {
+                       parent::outputNoResults();
+               }
        }
 }