From: Aaron Schulz Date: Mon, 6 Jun 2016 21:34:14 +0000 (-0700) Subject: Make edit stash keys less preference sensitive X-Git-Tag: 1.31.0-rc.0~6702^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=58886b169a552d41a63fbd30d05f4758e3a0ea50 Make edit stash keys less preference sensitive Only factor in the user ID/name/sig instead of anything that might happen to touch the user row. Bug: T136678 Change-Id: I004790a017c68cfcff6729f6fbfd0f79b6904c20 --- diff --git a/includes/api/ApiStashEdit.php b/includes/api/ApiStashEdit.php index e739e51688..01153a58c9 100644 --- a/includes/api/ApiStashEdit.php +++ b/includes/api/ApiStashEdit.php @@ -406,11 +406,15 @@ class ApiStashEdit extends ApiBase { */ private static function getStashKey( Title $title, Content $content, User $user ) { $hash = sha1( implode( ':', [ + // Account for the edit model/text $content->getModel(), $content->getDefaultFormat(), sha1( $content->serialize( $content->getDefaultFormat() ) ), - $user->getId() ?: md5( $user->getName() ), // account for user parser options - $user->getId() ? $user->getDBTouched() : '-' // handle preference change races + // Account for user name related variables like signatures + $user->getId(), + md5( $user->getName() ), + (string)$user->getOption( 'nickname' ), + (int)$user->getBoolOption( 'fancysig' ) ] ) ); return wfMemcKey( 'prepared-edit', md5( $title->getPrefixedDBkey() ), $hash );