jenkins-bot has submitted this change and it was merged.

Change subject: If isConfirmedEmail (already confirmed), skip dbtouch/hook call
......................................................................


If isConfirmedEmail (already confirmed), skip dbtouch/hook call

Bug: 46655
Change-Id: I5ea64611f68e01b1e82cd9dbe564123e81b17ed9
---
M includes/User.php
1 file changed, 6 insertions(+), 2 deletions(-)

Approvals:
  Aaron Schulz: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/User.php b/includes/User.php
index cc97774..2b7c787 100644
--- a/includes/User.php
+++ b/includes/User.php
@@ -3674,8 +3674,12 @@
         * @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;
        }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/56539
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I5ea64611f68e01b1e82cd9dbe564123e81b17ed9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to