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
/**
* @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;
}
/**