Skip to content
Snippets Groups Projects
Commit 4f11786a authored by Vincent Petry's avatar Vincent Petry
Browse files

Fixed Sabre Node implementation to correctly return timestamps as int

Negative timestamps were returned as string and were confusing other

Sabre API like Sabre_DAV_Property_GetLastModified.

This fix makes sure the timestamp is returned as int when defined.
parent d8f56e3c
No related branches found
No related tags found
No related merge requests found
...@@ -139,12 +139,15 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr ...@@ -139,12 +139,15 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr
/** /**
* @brief Returns the last modification time, as a unix timestamp * @brief Returns the last modification time, as a unix timestamp
* @return int * @return int timestamp as integer
*/ */
public function getLastModified() { public function getLastModified() {
$this->getFileinfoCache(); $this->getFileinfoCache();
return $this->fileinfo_cache['mtime']; $timestamp = $this->fileinfo_cache['mtime'];
if (!empty($timestamp)) {
return (int)$timestamp;
}
return $timestamp;
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment