r103602 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103601‎ | r103602 | r103603 >
Date:18:13, 18 November 2011
Author:jeroendedauw
Status:deferred (Comments)
Tags:
Comment:
bug 32469 patch
Modified paths:
  • /trunk/extensions/Validator/includes/Parameter.php (modified) (history)
  • /trunk/extensions/Validator/includes/manipulations/ParamManipulationBoolean.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Validator/includes/manipulations/ParamManipulationBoolean.php
@@ -30,7 +30,7 @@
3131 public function doManipulation( &$value, Parameter $parameter, array &$parameters ) {
3232 // When the value defaulted to a boolean, there is no need for this manipulation.
3333 if ( !is_bool( $value ) || !$parameter->wasSetToDefault() ) {
34 - $value = in_array( strtolower( $value ), array( 'yes', 'on' ) );
 34+ $value = in_array( strtolower( $value ), array( 'yes', 'on', '1' ) );
3535 }
3636 }
3737
Index: trunk/extensions/Validator/includes/Parameter.php
@@ -613,7 +613,7 @@
614614 break;
615615 case self::TYPE_BOOLEAN:
616616 // TODO: work with list of true and false values and i18n.
617 - $criteria[] = new CriterionInArray( 'yes', 'no', 'on', 'off' );
 617+ $criteria[] = new CriterionInArray( 'yes', 'no', 'on', 'off', '1', '0' );
618618 break;
619619 case self::TYPE_CHAR:
620620 $criteria[] = new CriterionHasLength( 1, 1 );

Comments

#Comment by Jeroen De Dauw (talk | contribs)   18:14, 18 November 2011

Fail.. it's bug 32466