Skip to content
Snippets Groups Projects
Commit e62eb2e8 authored by Jörn Friedrich Dreyer's avatar Jörn Friedrich Dreyer
Browse files

correctly handle error results of PDO and MDB2 backends

parent 7b6fcddb
No related branches found
No related tags found
No related merge requests found
......@@ -962,11 +962,14 @@ class OC_DB {
* @return bool
*/
public static function isError($result) {
if(self::$backend==self::BACKEND_PDO and $result === false) {
//PDO returns false on error (and throws an exception)
if (self::$backend===self::BACKEND_PDO and $result === false) {
return true;
}elseif(self::$backend==self::BACKEND_MDB2 and PEAR::isError($result)) {
} else
//MDB2 returns an MDB2_Error object
if (self::$backend===self::BACKEND_MDB2 and PEAR::isError($result)) {
return true;
}else{
} else {
return false;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment