From 091e5d24b1b712f21befa00e2a3c37303931d738 Mon Sep 17 00:00:00 2001 From: Rob Church Date: Fri, 18 Aug 2006 15:28:13 +0000 Subject: [PATCH] * (bug 7054) Validate email address before sending email confirmation message --- RELEASE-NOTES | 2 +- includes/SpecialConfirmemail.php | 6 +++++- languages/MessagesEn.php | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 1afb3411de..91a5fc60c4 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -142,7 +142,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Added {{CURRENTHOUR}} * Added [[:Image:Foo.png]] style links to the pagelinks table * Avoid duplicate revision imports with Special:Import - +* (bug 7054) Validate email address before sending email confirmation message == Languages updated == diff --git a/includes/SpecialConfirmemail.php b/includes/SpecialConfirmemail.php index fd0425a871..725676099b 100644 --- a/includes/SpecialConfirmemail.php +++ b/includes/SpecialConfirmemail.php @@ -30,7 +30,11 @@ class EmailConfirmation extends SpecialPage { global $wgUser, $wgOut; if( empty( $code ) ) { if( $wgUser->isLoggedIn() ) { - $this->showRequestForm(); + if( User::isValidEmailAddr( $wgUser->getEmail() ) ) { + $this->showRequestForm(); + } else { + $wgOut->addWikiText( wfMsg( 'confirmemail_noemail' ) ); + } } else { $title = Title::makeTitle( NS_SPECIAL, 'Userlogin' ); $self = Title::makeTitle( NS_SPECIAL, 'Confirmemail' ); diff --git a/languages/MessagesEn.php b/languages/MessagesEn.php index 6416d8a410..56591779c6 100644 --- a/languages/MessagesEn.php +++ b/languages/MessagesEn.php @@ -2275,6 +2275,7 @@ is collapsed. Others will be hidden by default. # E-mail address confirmation 'confirmemail' => 'Confirm E-mail address', +'confirmemail_noemail' => 'You do not have a valid email address set in your [[Special:Preferences|user preferences]].', 'confirmemail_text' => "This wiki requires that you validate your e-mail address before using e-mail features. Activate the button below to send a confirmation mail to your address. The mail will include a link containing a code; load the -- 2.20.1