r84016 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84015‎ | r84016 | r84017 >
Date:14:25, 15 March 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
small tweak
Modified paths:
  • /trunk/extensions/Validator/includes/manipulations/ParamManipulationBoolean.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Validator/includes/manipulations/ParamManipulationBoolean.php
@@ -28,7 +28,10 @@
2929 * @since 0.4
3030 */
3131 public function doManipulation( &$value, Parameter $parameter, array &$parameters ) {
32 - $value = in_array( $value, array( 'yes', 'on' ) );
 32+ // When the value defaulted to a booeal, there is no need for this manipulation.
 33+ if ( !is_bool( $value ) || !$parameter->wasSetToDefault() ) {
 34+ $value = in_array( $value, array( 'yes', 'on' ) );
 35+ }
3336 }
3437
3538 }
\ No newline at end of file

Status & tagging log