From dae1d3629872e9555c0fcde781321502332349cf Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sun, 14 Dec 2014 22:08:01 +0100 Subject: [PATCH] Work-around for glob() randomly failing for no reason Closes #1835 --- .../system/cache/builder/ControllerCacheBuilder.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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') { -- 2.20.1