summaryrefslogtreecommitdiffstats
path: root/lib/private/connector/sabre/node.php
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-04-08 11:57:33 +0200
committerVincent Petry <pvince81@owncloud.com>2014-04-09 15:46:51 +0200
commit4f11786a3d0d88a3bf43ae56cc9bb7a3023c83fb (patch)
treec1ca7e5764d7952aa4aee24a79f3e3ab4954e606 /lib/private/connector/sabre/node.php
parentd8f56e3c00e9cdba37b1155a4314398c7a124103 (diff)
downloadnextcloud-server-4f11786a3d0d88a3bf43ae56cc9bb7a3023c83fb.tar.gz
nextcloud-server-4f11786a3d0d88a3bf43ae56cc9bb7a3023c83fb.zip
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.
Diffstat (limited to 'lib/private/connector/sabre/node.php')
-rw-r--r--lib/private/connector/sabre/node.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/private/connector/sabre/node.php b/lib/private/connector/sabre/node.php
index 5807c5c7f71..7ff9f50ca68 100644
--- a/lib/private/connector/sabre/node.php
+++ b/lib/private/connector/sabre/node.php
@@ -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
- * @return int
+ * @return int timestamp as integer
*/
public function getLastModified() {
$this->getFileinfoCache();
- return $this->fileinfo_cache['mtime'];
-
+ $timestamp = $this->fileinfo_cache['mtime'];
+ if (!empty($timestamp)) {
+ return (int)$timestamp;
+ }
+ return $timestamp;
}
/**