]> source.dussan.org Git - nextcloud-server.git/commitdiff
Cast to number instead of integer in OC\Files\Cache\Cache
authorAndreas Fischer <bantu@owncloud.com>
Sat, 15 Feb 2014 23:50:03 +0000 (00:50 +0100)
committerAndreas Fischer <bantu@owncloud.com>
Thu, 29 May 2014 14:26:01 +0000 (16:26 +0200)
lib/private/files/cache/cache.php

index 3e4f6dfb13259faf6619a6e10f619c5e9597bf90..59963f41e3d00f591cfc173f6bbbe637b15ec35d 100644 (file)
@@ -142,11 +142,11 @@ class Cache {
                } else {
                        //fix types
                        $data['fileid'] = (int)$data['fileid'];
-                       $data['size'] = (int)$data['size'];
+                       $data['size'] = 0 + $data['size'];
                        $data['mtime'] = (int)$data['mtime'];
                        $data['storage_mtime'] = (int)$data['storage_mtime'];
                        $data['encrypted'] = (bool)$data['encrypted'];
-            $data['unencrypted_size'] = (int)$data['unencrypted_size'];
+            $data['unencrypted_size'] = 0 + $data['unencrypted_size'];
                        $data['storage'] = $this->storageId;
                        $data['mimetype'] = $this->getMimetype($data['mimetype']);
                        $data['mimepart'] = $this->getMimetype($data['mimepart']);
@@ -532,9 +532,9 @@ class Cache {
                        $result = \OC_DB::executeAudited($sql, array($id, $this->getNumericStorageId()));
                        if ($row = $result->fetchRow()) {
                                list($sum, $min, $unencryptedSum) = array_values($row);
-                               $sum = (int)$sum;
-                               $min = (int)$min;
-                               $unencryptedSum = (int)$unencryptedSum;
+                               $sum = 0 + $sum;
+                               $min = 0 + $min;
+                               $unencryptedSum = 0 + $unencryptedSum;
                                if ($min === -1) {
                                        $totalSize = $min;
                                } else {