From ec794e12c3d40fd936532f06537dc6eaa6a2f262 Mon Sep 17 00:00:00 2001 From: Matthew Flaschen Date: Thu, 28 Mar 2013 18:29:22 -0400 Subject: [PATCH] If isConfirmedEmail (already confirmed), skip dbtouch/hook call Bug: 46655 Change-Id: I5ea64611f68e01b1e82cd9dbe564123e81b17ed9 --- includes/User.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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; } -- 2.20.1