Skip to content

Commit 279586d

Browse files
committed
Fix for #677
1 parent 1c92b79 commit 279586d

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

api.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -3515,18 +3515,18 @@ private function clean(string $path, array $segments, int $len, bool $all) /*: v
35153515
if (strlen($entry) != $len) {
35163516
continue;
35173517
}
3518-
if (is_file($filename)) {
3518+
if (file_exists($filename) && is_file($filename)) {
35193519
if ($all || $this->getString($filename) == null) {
3520-
unlink($filename);
3520+
@unlink($filename);
35213521
}
35223522
}
35233523
} else {
35243524
if (strlen($entry) != $segments[0]) {
35253525
continue;
35263526
}
3527-
if (is_dir($filename)) {
3527+
if (file_exists($filename) && is_dir($filename)) {
35283528
$this->clean($filename, array_slice($segments, 1), $len - $segments[0], $all);
3529-
rmdir($filename);
3529+
@rmdir($filename);
35303530
}
35313531
}
35323532
}

src/Tqdev/PhpCrudApi/Cache/TempFileCache.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -121,18 +121,18 @@ private function clean(string $path, array $segments, int $len, bool $all) /*: v
121121
if (strlen($entry) != $len) {
122122
continue;
123123
}
124-
if (is_file($filename)) {
124+
if (file_exists($filename) && is_file($filename)) {
125125
if ($all || $this->getString($filename) == null) {
126-
unlink($filename);
126+
@unlink($filename);
127127
}
128128
}
129129
} else {
130130
if (strlen($entry) != $segments[0]) {
131131
continue;
132132
}
133-
if (is_dir($filename)) {
133+
if (file_exists($filename) && is_dir($filename)) {
134134
$this->clean($filename, array_slice($segments, 1), $len - $segments[0], $all);
135-
rmdir($filename);
135+
@rmdir($filename);
136136
}
137137
}
138138
}

0 commit comments

Comments
 (0)