From: Matthew Flaschen Date: Thu, 28 Mar 2013 22:29:22 +0000 (-0400) Subject: If isConfirmedEmail (already confirmed), skip dbtouch/hook call X-Git-Tag: 1.31.0-rc.0~20184^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/bilan.php?a=commitdiff_plain;h=ec794e12c3d40fd936532f06537dc6eaa6a2f262;p=lhc%2Fweb%2Fwiklou.git If isConfirmedEmail (already confirmed), skip dbtouch/hook call Bug: 46655 Change-Id: I5ea64611f68e01b1e82cd9dbe564123e81b17ed9 --- diff --git a/includes/User.php b/includes/User.php index cc97774daf..2b7c787548 100644 --- a/includes/User.php +++ b/includes/User.php @@ -3674,8 +3674,12 @@ class User { * @return bool */ public function confirmEmail() { - $this->setEmailAuthenticationTimestamp( wfTimestampNow() ); - wfRunHooks( 'ConfirmEmailComplete', array( $this ) ); + // Check if it's already confirmed, so we don't touch the database + // and fire the ConfirmEmailComplete hook on redundant confirmations. + if ( !$this->isEmailConfirmed() ) { + $this->setEmailAuthenticationTimestamp( wfTimestampNow() ); + wfRunHooks( 'ConfirmEmailComplete', array( $this ) ); + } return true; }