fix(vikon): fix excluded dirs matching for public/build and public/vikon_core
This commit is contained in:
@@ -60,9 +60,22 @@ class CheckAccessAction
|
||||
|
||||
$relative = str_replace(base_path() . '/', '', $path);
|
||||
|
||||
$excluded = ['vendor', 'node_modules', 'storage', '.git', 'bootstrap/cache'];
|
||||
$excluded = ['vendor', 'node_modules', 'storage', '.git', 'bootstrap/cache', 'build', 'vikon_core'];
|
||||
foreach ($excluded as $ex) {
|
||||
if (str_starts_with($relative, $ex)) return [];
|
||||
if (str_contains($relative, '/' . $ex) || $relative === $ex || str_starts_with($relative, $ex . '/')) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_writable($path)) {
|
||||
return [$relative];
|
||||
}
|
||||
|
||||
$result = [];
|
||||
foreach (File::directories($path) as $dir) {
|
||||
$result = array_merge($result, $this->findNonWritable($dir, $depth + 1));
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
if (!is_writable($path)) {
|
||||
|
||||
Reference in New Issue
Block a user