/** @var bool|Title */
protected $rclTargetTitle;
+ protected $rclTarget;
+
function __construct() {
parent::__construct( 'Recentchangeslinked' );
}
public function parseParameters( $par, FormOptions $opts ) {
$opts['target'] = $par;
+ $this->rclTarget = $par;
}
/**
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 );
+ }
}
* @return {mw.Uri} Updated Uri
*/
mw.rcfilters.UriProcessor.prototype.getUpdatedUri = function ( uriQuery ) {
- var uri = new mw.Uri(),
+ var titlePieces,
+ uri = new mw.Uri(),
unrecognizedParams = this.getUnrecognizedParams( uriQuery || uri.query );
if ( uriQuery ) {
uri.query = uriQuery;
}
+ // Normalize subpage to use &target= so we are always
+ // consistent in Special:RecentChangesLinked between the
+ // ?title=Special:RecentChangesLinked/TargetPage and
+ // ?title=Special:RecentChangesLinked&target=TargetPage
+ if ( uri.query.title && uri.query.title.indexOf( '/' ) !== -1 ) {
+ titlePieces = uri.query.title.split( '/' );
+
+ unrecognizedParams.title = titlePieces.shift();
+ unrecognizedParams.target = titlePieces.join( '/' );
+ }
+
uri.query = this.filtersModel.getMinimizedParamRepresentation(
$.extend(
true,
// Reapply unrecognized params and url version
uri.query = $.extend( true, {}, uri.query, unrecognizedParams, { urlversion: '2' } );
-
return uri;
};