[Pkg-owncloud-commits] [owncloud] 113/134: Fixed Sabre Node implementation to correctly return timestamps as int

David Prévot taffit at moszumanska.debian.org
Fri Apr 18 21:44:07 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit d4951c68f3167861d314c58052470c19f1a38669
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/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 993aa73..ed167aa 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;
 	}
 
 	/**

-- 
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