--- /var/www/atheos/traits/helpers.php.orig +++ /var/www/atheos/traits/helpers.php @@ -135,7 +135,18 @@ if (is_dir($target)) { - $files = glob($target . "{*,.[!.]*,..?*}", GLOB_BRACE|GLOB_MARK); //GLOB_MARK adds a slash to directories returned + // GLOB_BRACE is a glibc extension and is UNDEFINED under musl (Alpine), where + // referencing it is a fatal error in PHP 8. Expand the brace pattern by hand + // so this works on both libcs. + if (defined("GLOB_BRACE")) { + $files = glob($target . "{*,.[!.]*,..?*}", GLOB_BRACE | GLOB_MARK); + } else { + $files = array_merge( + glob($target . "/*", GLOB_MARK) ?: [], + glob($target . "/.[!.]*", GLOB_MARK) ?: [], + glob($target . "/..?*", GLOB_MARK) ?: [] + ); + } // $files = glob($target . "/*"); foreach ($files as $file) {