diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/FileInfo.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/private/Files/FileInfo.php b/lib/private/Files/FileInfo.php index 3ad2932e597..a0a3b0a782a 100644 --- a/lib/private/Files/FileInfo.php +++ b/lib/private/Files/FileInfo.php @@ -148,10 +148,12 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess { } /** - * @return int + * Get FileInfo ID or null in case of part file + * + * @return int/null */ public function getId() { - return $this->data['fileid']; + return isset($this->data['fileid']) ? intval($this->data['fileid']) : null; } /** @@ -193,7 +195,7 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess { */ public function getSize() { $this->updateEntryfromSubMounts(); - return isset($this->data['size']) ? $this->data['size'] : 0; + return isset($this->data['size']) ? intval($this->data['size']) : 0; } /** @@ -201,7 +203,7 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess { */ public function getMTime() { $this->updateEntryfromSubMounts(); - return $this->data['mtime']; + return intval($this->data['mtime']); } /** @@ -217,7 +219,7 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess { * @return int */ public function getEncryptedVersion() { - return isset($this->data['encryptedVersion']) ? (int) $this->data['encryptedVersion'] : 1; + return isset($this->data['encryptedVersion']) ? intval($this->data['encryptedVersion']) : 1; } /** @@ -228,7 +230,7 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess { if (\OCP\Util::isSharingDisabledForUser() || ($this->isShared() && !\OC\Share\Share::isResharingAllowed())) { $perms = $perms & ~\OCP\Constants::PERMISSION_SHARE; } - return $perms; + return intval($perms); } /** |