RCFilters: Respect subpage in RCLinked
[lhc/web/wiklou.git] / includes / specials / SpecialRecentchangeslinked.php
index 99880de..e4cc3d1 100644 (file)
@@ -30,6 +30,8 @@ class SpecialRecentChangesLinked extends SpecialRecentChanges {
        /** @var bool|Title */
        protected $rclTargetTitle;
 
+       protected $rclTarget;
+
        function __construct() {
                parent::__construct( 'Recentchangeslinked' );
        }
@@ -44,6 +46,7 @@ class SpecialRecentChangesLinked extends SpecialRecentChanges {
 
        public function parseParameters( $par, FormOptions $opts ) {
                $opts['target'] = $par;
+               $this->rclTarget = $par;
        }
 
        /**
@@ -62,8 +65,9 @@ class SpecialRecentChangesLinked extends SpecialRecentChanges {
                $outputPage = $this->getOutput();
                $title = Title::newFromText( $target );
                if ( !$title || $title->isExternal() ) {
-                       $outputPage->addHTML( '<div class="errorbox">' . $this->msg( 'allpagesbadtitle' )
-                                       ->parse() . '</div>' );
+                       $outputPage->addHTML(
+                               Html::errorBox( $this->msg( 'allpagesbadtitle' )->parse() )
+                       );
 
                        return false;
                }
@@ -292,4 +296,15 @@ class SpecialRecentChangesLinked extends SpecialRecentChanges {
        public function prefixSearchSubpages( $search, $limit, $offset ) {
                return $this->prefixSearchString( $search, $limit, $offset );
        }
+
+       /**
+        * Get a self-referential title object
+        * with consideration to the given subpage.
+        *
+        * @return Title
+        * @since 1.23
+        */
+       public function getPageTitle() {
+               return parent::getPageTitle( $this->rclTarget );
+       }
 }