Use "Unknown user" instead of an empty user name.
[lhc/web/wiklou.git] / includes / changes / ChangesList.php
index c0822c3..fea31b4 100644 (file)
@@ -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'] . '<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> ';
        }
 
        /**
@@ -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();