Skip to content
Snippets Groups Projects
Unverified Commit ae9ecd52 authored by Morris Jobke's avatar Morris Jobke Committed by GitHub
Browse files

Merge pull request #21677 from J0WI/clearstatcache-on-rmdir

Do clearstatcache() on rmdir
parents 2aa6256f 356bc504
No related branches found
No related tags found
No related merge requests found
......@@ -109,6 +109,7 @@ class Local extends \OC\Files\Storage\Common {
* @var \SplFileInfo $file
*/
$file = $it->current();
clearstatcache(true, $this->getSourcePath($file));
if (in_array($file->getBasename(), ['.', '..'])) {
$it->next();
continue;
......@@ -119,6 +120,7 @@ class Local extends \OC\Files\Storage\Common {
}
$it->next();
}
clearstatcache(true, $this->getSourcePath($path));
return rmdir($this->getSourcePath($path));
} catch (\UnexpectedValueException $e) {
return false;
......@@ -141,8 +143,8 @@ class Local extends \OC\Files\Storage\Common {
}
public function stat($path) {
clearstatcache();
$fullPath = $this->getSourcePath($path);
clearstatcache(true, $fullPath);
$statResult = stat($fullPath);
if (PHP_INT_SIZE === 4 && !$this->is_dir($path)) {
$filesize = $this->filesize($path);
......@@ -157,7 +159,7 @@ class Local extends \OC\Files\Storage\Common {
*/
public function getMetaData($path) {
$fullPath = $this->getSourcePath($path);
clearstatcache();
clearstatcache(true, $fullPath);
$stat = @stat($fullPath);
if (!$stat) {
return null;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment