mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-07 07:44:27 +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 = [];
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -141,6 +141,9 @@ class AddonManagerHelperTest extends TestCase
|
|||
$root = vfsStream::setup(__FUNCTION__ . '_addons', 0777, [
|
||||
'helloaddon' => [
|
||||
'helloaddon.php' => '<?php',
|
||||
],
|
||||
'.hidden' => [
|
||||
'.hidden.php' => 'This folder should be ignored',
|
||||
]
|
||||
]);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue