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 Aug 15, 2018
1 parent 60ad482 commit 5f1f330
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/WebDAVAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,14 @@ 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 = $object['{DAV:}getlastmodified'];
$datestring = substr($datestring, 0, strrpos($datestring, ' '));
$result['timestamp'] = strtotime($datestring);
}
}

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

0 comments on commit 5f1f330

Please sign in to comment.