From: Alexandre Emsenhuber Date: Fri, 8 Feb 2013 13:07:40 +0000 (+0100) Subject: Correct check whether the e-mail field was filled in Special:Userlogin/signup X-Git-Tag: 1.31.0-rc.0~20729^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/?a=commitdiff_plain;h=f0c82844d2702d3e0b908e36b424499b70091c3b;p=lhc%2Fweb%2Fwiklou.git Correct check whether the e-mail field was filled in Special:Userlogin/signup Use a strict comparison with '' instead of empty(), otherwise this allows user to give "0" as an e-mail address. Also use strval() if in any case null or something like that would be passed. Change-Id: Ide7d35c52a04d05b43ae9fd37f7586bb4a67d4ed --- diff --git a/includes/specials/SpecialUserlogin.php b/includes/specials/SpecialUserlogin.php index 63d101b8ee..6e4f5d47aa 100644 --- a/includes/specials/SpecialUserlogin.php +++ b/includes/specials/SpecialUserlogin.php @@ -392,11 +392,11 @@ class LoginForm extends SpecialPage { # if you need a confirmed email address to edit, then obviously you # need an email address. - if ( $wgEmailConfirmToEdit && empty( $this->mEmail ) ) { + if ( $wgEmailConfirmToEdit && strval( $this->mEmail ) === '' ) { return Status::newFatal( 'noemailtitle' ); } - if( !empty( $this->mEmail ) && !Sanitizer::validateEmail( $this->mEmail ) ) { + if ( strval( $this->mEmail ) !== '' && !Sanitizer::validateEmail( $this->mEmail ) ) { return Status::newFatal( 'invalidemailaddress' ); }