[Pkg-owncloud-commits] [owncloud] 39/55: Fixed Sabre Node implementation to correctly return timestamps as int
David Prévot
taffit at moszumanska.debian.org
Wed Apr 23 19:52:00 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to annotated tag v5.0.16RC1
in repository owncloud.
commit c67aaf6688b5ad359da47bde20258db4653e9640
Author: Vincent Petry <pvince81 at owncloud.com>
Date: Tue Apr 8 11:57:33 2014 +0200
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/connector/sabre/node.php | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/lib/connector/sabre/node.php b/lib/connector/sabre/node.php
index f6a1c56..cad87eb 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;
}
/**
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list