From d4951c68f3167861d314c58052470c19f1a38669 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Tue, 8 Apr 2014 11:57:33 +0200 Subject: [PATCH] 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 --- lib/private/connector/sabre/node.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/private/connector/sabre/node.php b/lib/private/connector/sabre/node.php index 993aa73faeb..ed167aaa669 100644 --- a/lib/private/connector/sabre/node.php +++ b/lib/private/connector/sabre/node.php @@ -134,12 +134,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; } /** -- 2.39.5