cvs: pear-core /PEAR Validate.php
| From: | Greg Beaver | Date: | Thu, 04 Nov 2004 04:21:48 +0000 |
| Subject: | cvs: pear-core /PEAR Validate.php | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-cvs+get-25659@lists.php.net to get a copy of this message | ||
cellog Wed Nov 3 23:21:48 2004 EDT
Modified files:
/pear-core/PEAR Validate.php
Log:
fix validateTime()/validateDate()
http://cvs.php.net/diff.php/pear-core/PEAR/Validate.php?r1=1.27&r2=1.28&ty=u
Index: pear-core/PEAR/Validate.php
diff -u pear-core/PEAR/Validate.php:1.27 pear-core/PEAR/Validate.php:1.28
--- pear-core/PEAR/Validate.php:1.27 Wed Nov 3 23:02:44 2004
+++ pear-core/PEAR/Validate.php Wed Nov 3 23:21:47 2004
@@ -16,7 +16,7 @@
// | Authors: Gregory Beaver <cellog@php.net> |
// +----------------------------------------------------------------------+
//
-// $Id: Validate.php,v 1.27 2004/11/04 04:02:44 cellog Exp $
+// $Id: Validate.php,v 1.28 2004/11/04 04:21:47 cellog Exp $
define('PEAR_VALIDATE_INSTALLING', 1);
define('PEAR_VALIDATE_UNINSTALLING', 2); // this is not bit-mapped like the others
define('PEAR_VALIDATE_NORMAL', 3);
@@ -425,12 +425,12 @@
if (!preg_match('/\d\d\d\d\-\d\d\-\d\d/',
$this->_packagexml->getDate())) {
$this->_addFailure('date', 'invalid release date "' .
- $this->_packagexml->getDate());
+ $this->_packagexml->getDate() . '"');
return false;
}
if (strtotime($this->_packagexml->getDate()) == -1) {
$this->_addFailure('date', 'invalid release date "' .
- $this->_packagexml->getDate());
+ $this->_packagexml->getDate() . '"');
return false;
}
}
@@ -450,14 +450,14 @@
// pear validate is called
if ($this->_state = PEAR_VALIDATE_NORMAL) {
if (!preg_match('/\d\d:\d\d:\d\d/',
- $this->_packagexml->getDate())) {
+ $this->_packagexml->getTime())) {
$this->_addFailure('time', 'invalid release time "' .
- $this->_packagexml->getDate());
+ $this->_packagexml->getTime() . '"');
return false;
}
- if (strtotime($this->_packagexml->getDate()) == -1) {
+ if (strtotime($this->_packagexml->getTime()) == -1) {
$this->_addFailure('time', 'invalid release time "' .
- $this->_packagexml->getDate());
+ $this->_packagexml->getTime() . '"');
return false;
}
}