summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-04-08 11:57:33 +0200
committerVincent Petry <pvince81@owncloud.com>2014-04-10 17:48:21 +0200
commitc67aaf6688b5ad359da47bde20258db4653e9640 (patch)
tree5b2dbabb1b54897b09407fd76bba177516827c19
parent9bc463de6e5ef5a811bc5d2b7de4889a7d718b2a (diff)
downloadnextcloud-server-c67aaf6688b5ad359da47bde20258db4653e9640.tar.gz
nextcloud-server-c67aaf6688b5ad359da47bde20258db4653e9640.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. Backport of 4f11786 from master
-rw-r--r--lib/connector/sabre/node.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/connector/sabre/node.php b/lib/connector/sabre/node.php
index f6a1c56edb8..cad87eb8582 100644
--- a/lib/connector/sabre/node.php
+++ b/lib/connector/sabre/node.php
@@ -126,12 +126,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;
}
/**