From: Jörn Friedrich Dreyer Date: Thu, 20 Jun 2013 12:49:10 +0000 (+0200) Subject: fix numRows usage in files_encryption X-Git-Tag: v6.0.0alpha2~578^2~2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c79f7f4f3cb460f890fccb5a7de7d62ea0a5fc15;p=nextcloud-server.git fix numRows usage in files_encryption --- 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;