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
# 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' );
}