Home » Database » DB_DataObject » Bug #4894
validate expression
Details
| Request #4894 | validate expression |
|---|---|
| Submitted | 2005-07-22 23:17 UTC |
| From | danny at osuosl dot org |
| Status | Closed |
| Package | DB_DataObject |
| PHP Version | 4.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.