Commit e0b797c4 authored by Vincent Petry's avatar Vincent Petry
Browse files

Merge pull request #12087 from AdamWill/google-touch

google: fix touch() when $mtime is set (Google wants RFC3339) #11267
parents 6e3a8416 f76419d1
...@@ -496,7 +496,10 @@ class Google extends \OC\Files\Storage\Common { ...@@ -496,7 +496,10 @@ class Google extends \OC\Files\Storage\Common {
$result = false; $result = false;
if ($file) { if ($file) {
if (isset($mtime)) { if (isset($mtime)) {
$file->setModifiedDate($mtime); // This is just RFC3339, but frustratingly, GDrive's API *requires*
// the fractions portion be present, while no handy PHP constant
// for RFC3339 or ISO8601 includes it. So we do it ourselves.
$file->setModifiedDate(date('Y-m-d\TH:i:s.uP', $mtime));
$result = $this->service->files->patch($file->getId(), $file, array( $result = $this->service->files->patch($file->getId(), $file, array(
'setModifiedDate' => true, 'setModifiedDate' => true,
)); ));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment