mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-07 20:44:32 +02:00
Ignore hidden addon folders
This commit is contained in:
parent
638496e553
commit
0078423b48
2 changed files with 6 additions and 1 deletions
|
@ -82,7 +82,9 @@ final class AddonManagerHelper implements AddonHelper
|
||||||
$files = [];
|
$files = [];
|
||||||
|
|
||||||
foreach ($dirs as $dirname) {
|
foreach ($dirs as $dirname) {
|
||||||
if (in_array($dirname, ['.', '..'])) {
|
// ignore hidden files and folders
|
||||||
|
// @TODO: Replace with str_starts_with() when PHP 8.0 is the minimum version
|
||||||
|
if (\strncmp($dirname, '.', 1) === 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -141,6 +141,9 @@ class AddonManagerHelperTest extends TestCase
|
||||||
$root = vfsStream::setup(__FUNCTION__ . '_addons', 0777, [
|
$root = vfsStream::setup(__FUNCTION__ . '_addons', 0777, [
|
||||||
'helloaddon' => [
|
'helloaddon' => [
|
||||||
'helloaddon.php' => '<?php',
|
'helloaddon.php' => '<?php',
|
||||||
|
],
|
||||||
|
'.hidden' => [
|
||||||
|
'.hidden.php' => 'This folder should be ignored',
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue