/** @var callable */
protected $changeLinePrefixer;
- /** @var BagOStuff */
+ /** @var MapCacheLRU */
protected $watchMsgCache;
/**
$this->skin = $obj;
}
$this->preCacheMessages();
- $this->watchMsgCache = new HashBagOStuff( [ 'maxKeys' => 50 ] );
+ $this->watchMsgCache = new MapCacheLRU( 50 );
$this->linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
$this->filterGroups = $filterGroups;
}
public function getTimestamp( $rc ) {
// @todo FIXME: Hard coded ". .". Is there a message for this? Should there be?
return $this->message['semicolon-separator'] . '<span class="mw-changeslist-date">' .
- $this->getLanguage()->userTime(
+ htmlspecialchars( $this->getLanguage()->userTime(
$rc->mAttribs['rc_timestamp'],
$this->getUser()
- ) . '</span> <span class="mw-changeslist-separator">. .</span> ';
+ ) ) . '</span> <span class="mw-changeslist-separator">. .</span> ';
}
/**
if ( $count <= 0 ) {
return '';
}
- $cache = $this->watchMsgCache;
- return $cache->getWithSetCallback(
- $cache->makeKey( 'watching-users-msg', $count ),
- $cache::TTL_INDEFINITE,
+
+ return $this->watchMsgCache->getWithSetCallback(
+ "watching-users-msg:$count",
function () use ( $count ) {
return $this->msg( 'number_of_watching_users_RCview' )
->numParams( $count )->escaped();