]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix numRows usage in files_encryption
authorJörn Friedrich Dreyer <jfd@butonic.de>
Thu, 20 Jun 2013 12:49:10 +0000 (14:49 +0200)
committerJörn Friedrich Dreyer <jfd@butonic.de>
Mon, 24 Jun 2013 14:29:59 +0000 (16:29 +0200)
apps/files_encryption/lib/util.php

index e8e53859bd8b621e6dc324bbbd5b22ab785a8f02..b3de85254e25327717f6af7beede1d4bdd04714b 100644 (file)
@@ -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;