Skip to content

Commit

Permalink
Adjust use of is_a().
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.php.net/repository/pear/packages/DB/trunk@315557 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information
Daniel Convissor committed Aug 26, 2011
1 parent 97461e8 commit cf230db
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DB.php
Expand Up @@ -591,7 +591,7 @@ function apiVersion()
*/ */
function isError($value) function isError($value)
{ {
return is_a($value, 'DB_Error'); return is_object($value) && is_a($value, 'DB_Error');
} }


// }}} // }}}
Expand Down
2 changes: 1 addition & 1 deletion DB/common.php
Expand Up @@ -1249,7 +1249,7 @@ function &limitQuery($query, $from, $count, $params = array())
return $query; return $query;
} }
$result = $this->query($query, $params); $result = $this->query($query, $params);
if (is_a($result, 'DB_result')) { if (is_object($result) && is_a($result, 'DB_result')) {
$result->setOption('limit_from', $from); $result->setOption('limit_from', $from);
$result->setOption('limit_count', $count); $result->setOption('limit_count', $count);
} }
Expand Down
2 changes: 1 addition & 1 deletion DB/mysqli.php
Expand Up @@ -993,7 +993,7 @@ function tableInfo($result, $mode = null)
$got_string = false; $got_string = false;
} }


if (!is_a($id, 'mysqli_result')) { if (!is_object($id) || !is_a($id, 'mysqli_result')) {
return $this->mysqliRaiseError(DB_ERROR_NEED_MORE_DATA); return $this->mysqliRaiseError(DB_ERROR_NEED_MORE_DATA);
} }


Expand Down

0 comments on commit cf230db

Please sign in to comment.