isNumber is valid with < 0

This commit is contained in:
real_nowhereman 2008-05-22 07:40:58 +00:00
parent b331e5870c
commit 537c8eca82
2 changed files with 2 additions and 2 deletions

View File

@ -91,7 +91,7 @@
<dt><label for="timeoffset"> {$panelstrings.timeoffset} </label></dt>
<dd><input type="text" name="timeoffset" id="timeoffset"
class="smalltextinput{$error.maxentries|notempty:" field-error"}"
class="smalltextinput{$error.timeoffset|notempty:" field-error"}"
value="{$fp_config.locale.timeoffset}" /> {$panelstrings.hours}
</dd>

View File

@ -37,7 +37,7 @@ function smarty_validate_criteria_isNumber($value, $empty, &$params, &$formvars)
if(strlen($value) == 0)
return $empty;
return preg_match('!^\d+(\.\d+)?$!', $value);
return preg_match('!^-?\d+(\.\d+)?$!', $value);
}
?>