Make ApiStashEdit::pruneExcessStashedEntries use user name
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 28 Mar 2019 01:25:46 +0000 (18:25 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Thu, 28 Mar 2019 01:25:46 +0000 (18:25 -0700)
Follow up to c334883309778

Change-Id: I35213d83a00b50bb469aab5bf8fbeb52239cff5e

includes/api/ApiStashEdit.php

index fe5f6c4..5184562 100644 (file)
@@ -477,7 +477,7 @@ class ApiStashEdit extends ApiBase {
         * @param string $newKey
         */
        private static function pruneExcessStashedEntries( BagOStuff $cache, User $user, $newKey ) {
-               $key = $cache->makeKey( 'stash-edit-recent', $user->getId() );
+               $key = $cache->makeKey( 'stash-edit-recent', sha1( $user->getName() ) );
 
                $keyList = $cache->get( $key ) ?: [];
                if ( count( $keyList ) >= self::MAX_CACHE_RECENT ) {