Skip to content
Merged
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 @@ -133,10 +133,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']) ? intval($this->data['fileid']) : null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm didn't we say we also allow string file ids ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interface says clearly, INT.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@labkode is that still a requirement ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PVince81 We are currently using int for file ids but we would like to use strings in the future.
The sync client already supports string file ids, if I remember correctly.

}

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

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

/**
Expand All @@ -199,7 +201,7 @@ public function isEncrypted() {
* @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;
}

/**
Expand All @@ -210,7 +212,7 @@ public function getPermissions() {
if (\OCP\Util::isSharingDisabledForUser() || ($this->isShared() && !\OC\Share\Share::isResharingAllowed())) {
$perms = $perms & ~\OCP\Constants::PERMISSION_SHARE;
}
return $perms;
return intval($perms);
}

/**
Expand Down