From: Alexander Ebert Date: Sun, 14 Dec 2014 21:08:01 +0000 (+0100) Subject: Work-around for glob() randomly failing for no reason X-Git-Tag: 2.1.0_Beta_2~41 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=dae1d3629872e9555c0fcde781321502332349cf;p=GitHub%2FWoltLab%2FWCF.git Work-around for glob() randomly failing for no reason Closes #1835 --- diff --git a/wcfsetup/install/files/lib/system/cache/builder/ControllerCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/ControllerCacheBuilder.class.php index d11639de75..78c75151fe 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/ControllerCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/ControllerCacheBuilder.class.php @@ -51,7 +51,12 @@ class ControllerCacheBuilder extends AbstractCacheBuilder { $controllers = array(); $path .= $type . '/'; - foreach (glob($path . '*' . ucfirst($type) . '.class.php') as $file) { + $files = glob($path . '*' . ucfirst($type) . '.class.php'); + if ($files === false) { + return array(); + } + + foreach ($files as $file) { $file = basename($file); if (preg_match('~^([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)(Action|Form|Page)\.class\.php$~', $file, $match)) { if ($match[1] === 'I') {