r74887 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74886‎ | r74887 | r74888 >
Date:09:53, 17 October 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Small fix to float regex
Modified paths:
  • /trunk/extensions/Validator/includes/criteria/CriterionIsFloat.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Validator/includes/criteria/CriterionIsFloat.php
@@ -26,7 +26,7 @@
2727 * @see ItemParameterCriterion::validate
2828 */
2929 protected function doValidation( $value, Parameter $parameter, array $parameters ) {
30 - return preg_match( '/^\d+(\.\d+)?$/', $value );
 30+ return preg_match( '/^(-)?\d+((\.|,)\d+)?$/', $value );
3131 }
3232
3333 /**

Status & tagging log