diff options
author | Bart Visscher <bartv@thisnet.nl> | 2013-06-28 07:15:38 -0700 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2013-06-28 07:15:38 -0700 |
commit | b1a2ddd1498f97129f5f425a77cc88879205357d (patch) | |
tree | 12f58228dbd1aa01636d5e4a1d0ce9eb22ced607 /apps | |
parent | 3bedb097537618fbdd462b9e77ac68e0b3d2302f (diff) | |
parent | 45c897acf34151672d68ee767ff15ab010676335 (diff) | |
download | nextcloud-server-b1a2ddd1498f97129f5f425a77cc88879205357d.tar.gz nextcloud-server-b1a2ddd1498f97129f5f425a77cc88879205357d.zip |
Merge pull request #3799 from owncloud/fix_pdo_statement_wrapper_numrows_on_modification
Fix pdo statement wrapper numrows on modification
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_encryption/lib/util.php | 18 | ||||
-rw-r--r-- | apps/user_ldap/lib/access.php | 6 | ||||
-rw-r--r-- | apps/user_ldap/lib/helper.php | 6 |
3 files changed, 8 insertions, 22 deletions
diff --git a/apps/files_encryption/lib/util.php b/apps/files_encryption/lib/util.php index e8e53859bd8..b3de85254e2 100644 --- a/apps/files_encryption/lib/util.php +++ b/apps/files_encryption/lib/util.php @@ -362,17 +362,7 @@ class Util { } - $query = \OCP\DB::prepare($sql); - - if ($query->execute($args)) { - - return true; - - } else { - - return false; - - } + return is_numeric(\OC_DB::executeAudited($sql, $args)); } @@ -1063,8 +1053,7 @@ class Util { $sql = 'UPDATE `*PREFIX*encryption` SET `migration_status` = ? WHERE `uid` = ? and `migration_status` = ?'; $args = array(self::MIGRATION_IN_PROGRESS, $this->userId, self::MIGRATION_OPEN); $query = \OCP\DB::prepare($sql); - $result = $query->execute($args); - $manipulatedRows = $result->numRows(); + $manipulatedRows = $query->execute($args); if ($manipulatedRows === 1) { $return = true; @@ -1087,8 +1076,7 @@ class Util { $sql = 'UPDATE `*PREFIX*encryption` SET `migration_status` = ? WHERE `uid` = ? and `migration_status` = ?'; $args = array(self::MIGRATION_COMPLETED, $this->userId, self::MIGRATION_IN_PROGRESS); $query = \OCP\DB::prepare($sql); - $result = $query->execute($args); - $manipulatedRows = $result->numRows(); + $manipulatedRows = $query->execute($args); if ($manipulatedRows === 1) { $return = true; diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php index 04f73cf01fe..6f6b8d0f016 100644 --- a/apps/user_ldap/lib/access.php +++ b/apps/user_ldap/lib/access.php @@ -578,14 +578,12 @@ abstract class Access { '); //feed the DB - $res = $insert->execute(array($dn, $ocname, $this->getUUID($dn), $dn, $ocname)); + $insRows = $insert->execute(array($dn, $ocname, $this->getUUID($dn), $dn, $ocname)); - if(\OCP\DB::isError($res)) { + if(\OCP\DB::isError($insRows)) { return false; } - $insRows = $res->numRows(); - if($insRows === 0) { return false; } diff --git a/apps/user_ldap/lib/helper.php b/apps/user_ldap/lib/helper.php index 10ed40ebd6a..f65f466789f 100644 --- a/apps/user_ldap/lib/helper.php +++ b/apps/user_ldap/lib/helper.php @@ -90,13 +90,13 @@ class Helper { AND `appid` = \'user_ldap\' AND `configkey` NOT IN (\'enabled\', \'installed_version\', \'types\', \'bgjUpdateGroupsLastRun\') '); - $res = $query->execute(array($prefix.'%')); + $delRows = $query->execute(array($prefix.'%')); - if(\OCP\DB::isError($res)) { + if(\OCP\DB::isError($delRows)) { return false; } - if($res->numRows() === 0) { + if($delRows === 0) { return false; } |