X-Git-Url: https://git.cyclocoop.org/%242?a=blobdiff_plain;f=includes%2Fchanges%2FChangesList.php;h=fea31b46d6b66c2080f5c9401cba2c9f12c2d46d;hb=db4fa6fb9ffc4601e7a02b6c30f22962db63615c;hp=c0822c3438c232dd09b7e1fa78d8c07db7eb59d2;hpb=cac0f01194d7ce89ae1da797e045bafa3df61188;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/changes/ChangesList.php b/includes/changes/ChangesList.php index c0822c3438..fea31b46d6 100644 --- a/includes/changes/ChangesList.php +++ b/includes/changes/ChangesList.php @@ -44,7 +44,7 @@ class ChangesList extends ContextSource { /** @var callable */ protected $changeLinePrefixer; - /** @var BagOStuff */ + /** @var MapCacheLRU */ protected $watchMsgCache; /** @@ -72,7 +72,7 @@ class ChangesList extends ContextSource { $this->skin = $obj; } $this->preCacheMessages(); - $this->watchMsgCache = new HashBagOStuff( [ 'maxKeys' => 50 ] ); + $this->watchMsgCache = new MapCacheLRU( 50 ); $this->linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer(); $this->filterGroups = $filterGroups; } @@ -531,10 +531,10 @@ class ChangesList extends ContextSource { public function getTimestamp( $rc ) { // @todo FIXME: Hard coded ". .". Is there a message for this? Should there be? return $this->message['semicolon-separator'] . '' . - $this->getLanguage()->userTime( + htmlspecialchars( $this->getLanguage()->userTime( $rc->mAttribs['rc_timestamp'], $this->getUser() - ) . ' . . '; + ) ) . ' . . '; } /** @@ -602,10 +602,9 @@ class ChangesList extends ContextSource { 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();