Fixed $flags bit operation precedence fail in User::loadFromDatabase()
[lhc/web/wiklou.git] / includes / User.php
index 7902119..fc07b6d 100644 (file)
@@ -1229,7 +1229,7 @@ class User implements IDBAccessObject {
                        self::selectFields(),
                        array( 'user_id' => $this->mId ),
                        __METHOD__,
-                       ( $flags & self::READ_LOCKING == self::READ_LOCKING )
+                       ( ( $flags & self::READ_LOCKING ) == self::READ_LOCKING )
                                ? array( 'LOCK IN SHARE MODE' )
                                : array()
                );
@@ -2301,11 +2301,10 @@ class User implements IDBAccessObject {
         * Called implicitly from invalidateCache() and saveSettings().
         */
        public function clearSharedCache() {
-               $this->load();
-               if ( $this->mId ) {
+               $id = $this->getId();
+               if ( $id ) {
                        $cache = ObjectCache::getMainWANInstance();
-
-                       $cache->delete( wfMemcKey( 'user', 'id', $this->mId ) );
+                       $cache->delete( wfMemcKey( 'user', 'id', $id ) );
                }
        }