mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 09:13:19 -04:00
correctly handle error results of PDO and MDB2 backends
This commit is contained in:
parent
7b6fcddbc5
commit
e62eb2e8d1
1 changed files with 6 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue