cvs: pear /Validate Validate.php
| From: | Amir Mohammad Saied | Date: | Thu, 05 Oct 2006 05:51:00 +0000 |
| Subject: | cvs: pear /Validate Validate.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-42419@lists.php.net to get a copy of this message | ||
amir Thu Oct 5 05:51:00 2006 UTC
Modified files:
/pear/Validate Validate.php
Log:
s/is_int/preg_match/, is_int does not what we want
http://cvs.php.net/viewvc.cgi/pear/Validate/Validate.php?r1=1.98&r2=1.99&diff_format=u
Index: pear/Validate/Validate.php
diff -u pear/Validate/Validate.php:1.98 pear/Validate/Validate.php:1.99
--- pear/Validate/Validate.php:1.98 Thu Oct 5 04:41:35 2006
+++ pear/Validate/Validate.php Thu Oct 5 05:51:00 2006
@@ -32,7 +32,7 @@
* @author Pierre-Alain Joye <pajoye@php.net>
* @copyright 1997-2005 Pierre-Alain Joye,Tomas V.V.Cox
* @license http://www.opensource.org/licenses/bsd-license.php
New BSD License
- * @version CVS: $Id: Validate.php,v 1.98 2006/10/05 04:41:35 amir Exp $
+ * @version CVS: $Id: Validate.php,v 1.99 2006/10/05 05:51:00 amir Exp $
* @link http://pear.php.net/package/Validate
*/
@@ -156,7 +156,11 @@
} elseif (($i == strlen($string) ||
!((ord($char) >= 0x7F)) || (ord($char) <= 0x1F))) {
if ($state != 1) {
- $return .= $utf7[ord($char)];
+ if (ord($char) > 64) {
+ $return .= '';
+ } else {
+ $return .= $utf7[ord($char)];
+ }
}
$return .= '-';
$state = 0;
@@ -496,7 +500,7 @@
} else {
$hour = Validate::_substr($date, 2);
}
- if (!is_int($hour) || $hour < 0 || $hour > 12) {
+ if (!preg_match('/^\d+$/', $hour) || $hour < 0 || $hour >
12) {
return false;
}
break;
@@ -507,14 +511,14 @@
} else {
$hour = Validate::_substr($date, 2);
}
- if (!is_int($hour) || $hour < 0 || $hour > 24) {
+ if (!preg_match('/^\d+$/', $hour) || $hour < 0 || $hour >
24) {
return false;
}
break;
case 's':
case 'i':
$t = Validate::_substr($date, 2);
- if (!is_int($t) || $t < 0 || $t > 59) {
+ if (!preg_match('/^\d+$/', $t) || $t < 0 || $t > 59) {
return false;
}
break;