Skip to content

Commit

Permalink
Fix for unknown timezone
Browse files Browse the repository at this point in the history
  • Loading branch information
sdvallejo committed Oct 16, 2018
1 parent 60ad482 commit 1adefdd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/WebDAVAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,13 @@ protected function normalizeObject(array $object, $path)
$result = Util::map($object, static::$resultMap);

if (isset($object['{DAV:}getlastmodified'])) {
$result['timestamp'] = strtotime($object['{DAV:}getlastmodified']);
$datestring = $object['{DAV:}getlastmodified'];
$result['timestamp'] = strtotime($datestring);

if ($result['timestamp'] === false) {
$datestring = substr($datestring, 0, strrpos($datestring, ' '));
$result['timestamp'] = strtotime($datestring);
}
}

$result['type'] = 'file';
Expand Down

0 comments on commit 1adefdd

Please sign in to comment.