From: Antoine Musso Date: Wed, 26 Apr 2006 17:17:57 +0000 (+0000) Subject: Fix #5728: mVersion missing from User::__sleep() leading to constant cache miss X-Git-Tag: 1.31.0-rc.0~57366 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=89a1491474bf8d33217440eaa7b1de83b66579ea;p=lhc%2Fweb%2Fwiklou.git Fix #5728: mVersion missing from User::__sleep() leading to constant cache miss --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index e796bda42f..fb9c3fbc20 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -125,6 +125,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN ("editinginterface") * (bug 4834) Fix XHTML output when using $wgMaxTocLevel * Pass login link to "whitelistedittext" containing 'returnto' parameter +* (bug 5728): mVersion missing from User::__sleep() leading to constant cache miss == Compatibility == diff --git a/includes/User.php b/includes/User.php index 52570670f7..bd8b06c4bc 100644 --- a/includes/User.php +++ b/includes/User.php @@ -21,6 +21,9 @@ define( 'MW_USER_VERSION', 3 ); * @package MediaWiki */ class User { + /* + * When adding a new private variable, dont forget to add it to __sleep() + */ /**@{{ * @private */ @@ -110,13 +113,31 @@ class User { /** * Serialze sleep function, for better cache efficiency and avoidance of - * silly "incomplete type" errors when skins are cached + * silly "incomplete type" errors when skins are cached. The array should + * contain names of private variables (see at top of User.php). */ function __sleep() { - return array( 'mId', 'mName', 'mPassword', 'mEmail', 'mNewtalk', - 'mEmailAuthenticated', 'mRights', 'mOptions', 'mDataLoaded', - 'mNewpassword', 'mBlockedby', 'mBlockreason', 'mTouched', - 'mToken', 'mRealName', 'mHash', 'mGroups', 'mRegistration' ); + return array( +'mBlockedby', +'mBlockreason', +'mDataLoaded', +'mEmail', +'mEmailAuthenticated', +'mGroups', +'mHash', +'mId', +'mName', +'mNewpassword', +'mNewtalk', +'mOptions', +'mPassword', +'mRealName', +'mRegistration', +'mRights', +'mToken', +'mTouched', +'mVersion', +); } /**