From: jenkins-bot Date: Mon, 16 Mar 2015 18:00:02 +0000 (+0000) Subject: Merge "Re-introduce AvailableRightsTest for User::getAllRights completeness" X-Git-Tag: 1.31.0-rc.0~12080 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=b15cd2ee45c5d1dbd58ea3df0becedc43a74ed94;hp=-c;p=lhc%2Fweb%2Fwiklou.git Merge "Re-introduce AvailableRightsTest for User::getAllRights completeness" --- b15cd2ee45c5d1dbd58ea3df0becedc43a74ed94 diff --combined includes/User.php index c811dd5d29,027f1c1dbe..b1d434d538 --- a/includes/User.php +++ b/includes/User.php @@@ -1240,10 -1240,6 +1240,10 @@@ class User implements IDBAccessObject $all = false; } + if ( isset( $row->user_id ) && isset( $row->user_name ) ) { + self::$idCacheByName[$row->user_name] = $row->user_id; + } + if ( isset( $row->user_editcount ) ) { $this->mEditCount = $row->user_editcount; } else { @@@ -2011,7 -2007,17 +2011,7 @@@ // Anon newtalk disabled by configuration. $this->mNewtalk = false; } else { - global $wgMemc; - $key = wfMemcKey( 'newtalk', 'ip', $this->getName() ); - $newtalk = $wgMemc->get( $key ); - if ( strval( $newtalk ) !== '' ) { - $this->mNewtalk = (bool)$newtalk; - } else { - // Since we are caching this, make sure it is up to date by getting it - // from the master - $this->mNewtalk = $this->checkNewtalk( 'user_ip', $this->getName(), true ); - $wgMemc->set( $key, (int)$this->mNewtalk, 1800 ); - } + $this->mNewtalk = $this->checkNewtalk( 'user_ip', $this->getName() ); } } else { $this->mNewtalk = $this->checkNewtalk( 'user_id', $this->mId ); @@@ -3365,9 -3371,7 +3365,9 @@@ * @param WebRequest|null $request WebRequest object to use; $wgRequest will be used if null * is passed. */ - protected function setCookie( $name, $value, $exp = 0, $secure = null, $params = array(), $request = null ) { + protected function setCookie( + $name, $value, $exp = 0, $secure = null, $params = array(), $request = null + ) { if ( $request === null ) { $request = $this->getRequest(); } @@@ -4412,7 -4416,7 +4412,7 @@@ /** * Get a list of all available permissions. - * @return array Array of permission names + * @return string[] Array of permission names */ public static function getAllRights() { if ( self::$mAllRights === false ) {