Index: branches/preferences-work/phase3/includes/HTMLForm.php |
— | — | @@ -526,6 +526,10 @@ |
527 | 527 | function validate( $value, $alldata ) { |
528 | 528 | $p = parent::validate( $value, $alldata ); |
529 | 529 | if ($p !== true) return $p; |
| 530 | + |
| 531 | + if (!is_string($value) && !is_int($value)) |
| 532 | + return false; |
| 533 | + |
530 | 534 | if ( array_key_exists( $value, $this->mParams['options'] ) ) |
531 | 535 | return true; |
532 | 536 | else |
Index: branches/preferences-work/phase3/includes/Preferences.php |
— | — | @@ -819,7 +819,8 @@ |
820 | 820 | |
821 | 821 | static function validateEmail( $email, $alldata ) { |
822 | 822 | global $wgUser; // To check |
823 | | - if ( !$wgUser->isValidEmailAddr( $email ) ) { |
| 823 | + |
| 824 | + if ( $email && !$wgUser->isValidEmailAddr( $email ) ) { |
824 | 825 | return wfMsgExt( 'invalidemailaddress', 'parseinline' ); |
825 | 826 | } |
826 | 827 | |