Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2020-08-06 00:03:06 +0300
committerGitHub <noreply@github.com>2020-08-06 00:03:06 +0300
commitae9ecd521fbc24f2aa920cc5fb1b9e480bede848 (patch)
treebaa8f41e9f410fff889446439c306829948982eb
parent2aa6256f380d5a93872f99ff65b0a4a694b11c9a (diff)
parent356bc50420d83254a622ccd1a5e6bc9a623c4427 (diff)
Merge pull request #21677 from J0WI/clearstatcache-on-rmdir
Do clearstatcache() on rmdir
-rw-r--r--lib/private/Files/Storage/Local.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/private/Files/Storage/Local.php b/lib/private/Files/Storage/Local.php
index 0b636d06bde..552e996b90b 100644
--- a/lib/private/Files/Storage/Local.php
+++ b/lib/private/Files/Storage/Local.php
@@ -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;