Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions lib/private/Files/FileInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,12 @@ public function getInternalPath() {
}

/**
* @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']) ? (int) $this->data['fileid'] : null;
}

/**
Expand Down Expand Up @@ -193,15 +195,15 @@ public function getEtag() {
*/
public function getSize() {
$this->updateEntryfromSubMounts();
return isset($this->data['size']) ? $this->data['size'] : 0;
return isset($this->data['size']) ? (int) $this->data['size'] : 0;
}

/**
* @return int
*/
public function getMTime() {
$this->updateEntryfromSubMounts();
return $this->data['mtime'];
return (int) $this->data['mtime'];
}

/**
Expand All @@ -224,11 +226,11 @@ public function getEncryptedVersion() {
* @return int
*/
public function getPermissions() {
$perms = $this->data['permissions'];
$perms = (int) $this->data['permissions'];
if (\OCP\Util::isSharingDisabledForUser() || ($this->isShared() && !\OC\Share\Share::isResharingAllowed())) {
$perms = $perms & ~\OCP\Constants::PERMISSION_SHARE;
}
return $perms;
return (int) $perms;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/public/Files/FileInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public function getStorage();
/**
* Get the file id of the file or folder
*
* @return int
* @return int|null
* @since 7.0.0
*/
public function getId();
Expand Down