PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Database » DB_DataObject » Bug #4894

validate expression

Details

Request #4894validate expression
Submitted2005-07-22 23:17 UTC
Fromdanny at osuosl dot org
StatusClosed
PackageDB_DataObject
PHP Version4.3.10
Roadmaps(Not assigned)

Comments

[2005-07-22 23:17 UTC] danny at osuosl dot org

Description:
------------
In DataObject.php, you test the resulting validation array, as follows:

foreach ($ret as $key => $val) {
if ($val === false) {
return $ret;
}
}
return true; // everything is OK.

I propose you modify it as follows:

foreach ($ret as $key => $val) {
if ($val !== true) {
return $ret;
}
}
return true; // everything is OK.

This will allow a simple extension to validate() where error messages are returned, not just true/false, while preserving existing functionality.