r49364 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49363‎ | r49364 | r49365 >
Date:14:04, 10 April 2009
Author:werdna
Status:deferred
Tags:
Comment:
Fix silly validation errors and fatals
Modified paths:
  • /branches/preferences-work/phase3/includes/HTMLForm.php (modified) (history)
  • /branches/preferences-work/phase3/includes/Preferences.php (modified) (history)

Diff [purge]

Index: branches/preferences-work/phase3/includes/HTMLForm.php
@@ -526,6 +526,10 @@
527527 function validate( $value, $alldata ) {
528528 $p = parent::validate( $value, $alldata );
529529 if ($p !== true) return $p;
 530+
 531+ if (!is_string($value) && !is_int($value))
 532+ return false;
 533+
530534 if ( array_key_exists( $value, $this->mParams['options'] ) )
531535 return true;
532536 else
Index: branches/preferences-work/phase3/includes/Preferences.php
@@ -819,7 +819,8 @@
820820
821821 static function validateEmail( $email, $alldata ) {
822822 global $wgUser; // To check
823 - if ( !$wgUser->isValidEmailAddr( $email ) ) {
 823+
 824+ if ( $email && !$wgUser->isValidEmailAddr( $email ) ) {
824825 return wfMsgExt( 'invalidemailaddress', 'parseinline' );
825826 }
826827

Status & tagging log