Solve bug with touch always return true on /lib/private/files/view.php

This commit is contained in:
Jesus Macias 2014-09-03 12:08:22 +02:00
parent 6cdb1d89ae
commit 819fa01e20
2 changed files with 8 additions and 2 deletions

@ -1 +1 @@
Subproject commit 57245d2a64c99aab8a438f909988e7a4ffef5b23
Subproject commit 554277edd6155ca3f5b21e32fe16b818d7fb827e

View File

@ -304,7 +304,13 @@ class View {
$hooks[] = 'write';
}
$result = $this->basicOperation('touch', $path, $hooks, $mtime);
if (!$result) { //if native touch fails, we emulate it by changing the mtime in the cache
if (!$result) {
// If create file fails because of permissions on external extorage like sharepoint,
// check file exists and return false if not.
if(!$this->file_exists($path)){
return false;
}
//if native touch fails, we emulate it by changing the mtime in the cache
$this->putFileInfo($path, array('mtime' => $mtime));
}
return true;