X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FUser.php;h=a01444a1a930104a530f54a3660e8a1718f2474b;hb=c21a77b35601753a50e236f1b231cd1383fd40a2;hp=c86b966ffed293713cd4873ca62e514094686721;hpb=66f3cc0c2d048b6b0697187ae4a8b99ffdab98f7;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/User.php b/includes/User.php index c86b966ffe..a01444a1a9 100644 --- a/includes/User.php +++ b/includes/User.php @@ -2173,14 +2173,21 @@ class User { /** * Set the password for a password reminder or new account email * - * @param string $str New password to set + * @param $str New password to set or null to set an invalid + * password hash meaning that the user will not be able to use it * @param bool $throttle If true, reset the throttle timestamp to the present */ public function setNewpassword( $str, $throttle = true ) { $this->load(); - $this->mNewpassword = self::crypt( $str ); - if ( $throttle ) { - $this->mNewpassTime = wfTimestampNow(); + + if ( $str === null ) { + $this->mNewpassword = ''; + $this->mNewpassTime = null; + } else { + $this->mNewpassword = self::crypt( $str ); + if ( $throttle ) { + $this->mNewpassTime = wfTimestampNow(); + } } } @@ -3506,56 +3513,6 @@ class User { return (bool)$userblock->doAutoblock( $this->getRequest()->getIP() ); } - /** - * Generate a string which will be different for any combination of - * user options which would produce different parser output. - * This will be used as part of the hash key for the parser cache, - * so users with the same options can share the same cached data - * safely. - * - * Extensions which require it should install 'PageRenderingHash' hook, - * which will give them a chance to modify this key based on their own - * settings. - * - * @deprecated since 1.17 use the ParserOptions object to get the relevant options - * @return string Page rendering hash - */ - public function getPageRenderingHash() { - wfDeprecated( __METHOD__, '1.17' ); - - global $wgRenderHashAppend, $wgLang, $wgContLang; - if ( $this->mHash ) { - return $this->mHash; - } - - // stubthreshold is only included below for completeness, - // since it disables the parser cache, its value will always - // be 0 when this function is called by parsercache. - - $confstr = $this->getOption( 'math' ); - $confstr .= '!' . $this->getStubThreshold(); - $confstr .= '!' . ( $this->getOption( 'numberheadings' ) ? '1' : '' ); - $confstr .= '!' . $wgLang->getCode(); - $confstr .= '!' . $this->getOption( 'thumbsize' ); - // add in language specific options, if any - $extra = $wgContLang->getExtraHashOptions(); - $confstr .= $extra; - - // Since the skin could be overloading link(), it should be - // included here but in practice, none of our skins do that. - - $confstr .= $wgRenderHashAppend; - - // Give a chance for extensions to modify the hash, if they have - // extra options or other effects on the parser cache. - wfRunHooks( 'PageRenderingHash', array( &$confstr ) ); - - // Make it a valid memcached key fragment - $confstr = str_replace( ' ', '_', $confstr ); - $this->mHash = $confstr; - return $confstr; - } - /** * Get whether the user is explicitly blocked from account creation. * @return bool|Block