fix(vikon): fix excluded dirs matching for public/build and public/vikon_core
This commit is contained in:
@@ -60,15 +60,28 @@ class CheckAccessAction
|
|||||||
|
|
||||||
$relative = str_replace(base_path() . '/', '', $path);
|
$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) {
|
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)) {
|
if (!is_writable($path)) {
|
||||||
return [$relative];
|
return [$relative];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$result = [];
|
||||||
|
foreach (File::directories($path) as $dir) {
|
||||||
|
$result = array_merge($result, $this->findNonWritable($dir, $depth + 1));
|
||||||
|
}
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!is_writable($path)) {
|
||||||
|
return [$relative];
|
||||||
|
}
|
||||||
|
|
||||||
$result = [];
|
$result = [];
|
||||||
foreach (File::directories($path) as $dir) {
|
foreach (File::directories($path) as $dir) {
|
||||||
$result = array_merge($result, $this->findNonWritable($dir, $depth + 1));
|
$result = array_merge($result, $this->findNonWritable($dir, $depth + 1));
|
||||||
|
|||||||
Reference in New Issue
Block a user