Mattflaschen has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/56539


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(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/39/56539/1

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: newchange
Gerrit-Change-Id: I5ea64611f68e01b1e82cd9dbe564123e81b17ed9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen <[email protected]>

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

Reply via email to