http://www.mediawiki.org/wiki/Special:Code/MediaWiki/65782
Revision: 65782 Author: jeroendedauw Date: 2010-05-02 04:51:27 +0000 (Sun, 02 May 2010) Log Message: ----------- Fixed bug in float parameter type validation Modified Paths: -------------- trunk/extensions/Validator/Validator.php trunk/extensions/Validator/Validator_Functions.php Modified: trunk/extensions/Validator/Validator.php =================================================================== --- trunk/extensions/Validator/Validator.php 2010-05-02 04:34:01 UTC (rev 65781) +++ trunk/extensions/Validator/Validator.php 2010-05-02 04:51:27 UTC (rev 65782) @@ -24,7 +24,7 @@ die( 'Not an entry point.' ); } -define( 'Validator_VERSION', '0.3 a3' ); +define( 'Validator_VERSION', '0.3 a4' ); // Constants indicating the strictness of the parameter validation. define( 'Validator_ERRORS_NONE', 0 ); Modified: trunk/extensions/Validator/Validator_Functions.php =================================================================== --- trunk/extensions/Validator/Validator_Functions.php 2010-05-02 04:34:01 UTC (rev 65781) +++ trunk/extensions/Validator/Validator_Functions.php 2010-05-02 04:51:27 UTC (rev 65782) @@ -145,7 +145,8 @@ } /** - * Wrapper for the native is_float function. + * Returns if the value is a floating point number. + * Does NOT check the type of the variable like the native is_float function. * * @param $value * @param array $metaData @@ -153,6 +154,6 @@ * @return boolean */ public static function is_float( $value, array $metaData ) { - return is_float( $value ); + return preg_match( '/^\d+(\.\d+)?$/', $value ); } } _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs