summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChuck Hagenbuch <chagenbu@php.net>2001-01-26 20:07:22 +0000
committerChuck Hagenbuch <chagenbu@php.net>2001-01-26 20:07:22 +0000
commitb4378dcf80153d66caef456b451ebbf1fd82ee72 (patch)
treed84b8bbd93391ffdedc6fe84d72783bdfe0e7653
parenta06f392ae4f0937a7635ea8680bacc84014ff6e2 (diff)
downloadphp-git-b4378dcf80153d66caef456b451ebbf1fd82ee72.tar.gz
have DB::isError return true if passed "null". Now you can more consistently
use DB::isError(), since some of the db drivers return nulls from various functions (like fetchRow()), and others don't... We should probably make all of them just return errors. I did this for the mysql driver, as a start.
-rw-r--r--pear/DB.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/pear/DB.php b/pear/DB.php
index 788aed02fc..3c706c0aac 100644
--- a/pear/DB.php
+++ b/pear/DB.php
@@ -242,9 +242,10 @@ class DB
*/
function isError($value)
{
- return is_object($value) &&
- (get_class($value) == "db_error" ||
- is_subclass_of($value, "db_error"));
+ return (is_object($value) &&
+ (get_class($value) == "db_error" ||
+ is_subclass_of($value, "db_error")) ||
+ !isset($value));
}
/**