PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

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.