*/
public function getDefaultOptions() {
$opts = parent::getDefaultOptions();
- $user = $this->getUser();
- $opts->add( 'days', $user->getIntOption( 'rcdays' ), FormOptions::FLOAT );
- $opts->add( 'limit', $user->getIntOption( 'rclimit' ) );
+ $opts->add( 'days', $this->getDefaultDays(), FormOptions::FLOAT );
+ $opts->add( 'limit', $this->getDefaultLimit() );
$opts->add( 'from', '' );
$opts->add( 'categories', '' );
$opts->add( 'categories_any', false );
- $opts->add( 'tagfilter', '' );
return $opts;
}
$message = $this->msg( 'recentchangestext' )->inContentLanguage();
if ( !$message->isDisabled() ) {
- $content = $message->parse();
+ // Parse the message in this weird ugly way to preserve the ability to include interlanguage
+ // links in it (T172461). In the future when T66969 is resolved, perhaps we can just use
+ // $message->parse() instead. This code is copied from Message::parseText().
+ $parserOutput = MessageCache::singleton()->parse(
+ $message->plain(),
+ $this->getPageTitle(),
+ /*linestart*/true,
+ // Message class sets the interface flag to false when parsing in a language different than
+ // user language, and this is wiki content language
+ /*interface*/false,
+ $wgContLang
+ );
+ $content = $parserOutput->getText();
+ // Add only metadata here (including the language links), text is added below
+ $this->getOutput()->addParserOutputMetadata( $parserOutput );
$langAttributes = [
'lang' => $wgContLang->getHtmlCode(),
protected function getCacheTTL() {
return 60 * 5;
}
+
+ function getDefaultLimit() {
+ return $this->getUser()->getIntOption( 'rclimit' );
+ }
+
+ function getDefaultDays() {
+ return floatval( $this->getUser()->getOption( 'rcdays' ) );
+ }
}