1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-13 18:24:57 +02:00

Updates per processwire/processwire-issues#704 with WireTempDir log entries

This commit is contained in:
Ryan Cramer
2018-11-29 11:12:11 -05:00
parent cc212b3254
commit fcc353bc3c
2 changed files with 6 additions and 3 deletions

View File

@@ -276,7 +276,7 @@ class WireTempDir extends Wire {
}
}
if(!$numSubdirs) {
if(!$numSubdirs && $path != $this->classRoot && $this->isTempDir($path)) {
// if no subdirectories, we can remove the root
if($this->rmdir($path, true)) {
$success = true;
@@ -381,10 +381,13 @@ class WireTempDir extends Wire {
*
*/
protected function isTempDir($dir) {
$files = $this->wire('files');
if(!strlen($dir) || !is_dir($dir)) {
// if given a non-directory return false
return false;
} else if($this->classRoot && $this->wire('files')->fileInPath($dir, $this->classRoot)) {
}
if($this->classRoot && $files->fileInPath($dir, $this->classRoot)) {
// dir is within classRoot path
return true;
}
return false;