From 705822fe7aaf002fc2c22baed444322579da69d1 Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Fri, 22 Mar 2024 02:36:41 +0100 Subject: [PATCH] Log debug message for failing custom themes directory #1508 --- .../app/libraries/RainLoop/Actions/Themes.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Themes.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Themes.php index 01779808d..9d70fbbbd 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Themes.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/Themes.php @@ -56,14 +56,18 @@ trait Themes } $sDir = APP_INDEX_ROOT_PATH . 'themes'; // custom user themes - if (\is_dir($sDir) && ($rDirH = \opendir($sDir))) { - while (($sFile = \readdir($rDirH)) !== false) { - if ('.' !== $sFile[0] && \is_dir($sDir . '/' . $sFile) - && (\file_exists("{$sDir}/{$sFile}/styles.css") || \file_exists("{$sDir}/{$sFile}/styles.less"))) { - $aCache[] = $sFile . '@custom'; + if (\is_dir($sDir)) { + if ($rDirH = \opendir($sDir)) { + while (($sFile = \readdir($rDirH)) !== false) { + if ('.' !== $sFile[0] && \is_dir($sDir . '/' . $sFile) + && (\file_exists("{$sDir}/{$sFile}/styles.css") || \file_exists("{$sDir}/{$sFile}/styles.less"))) { + $aCache[] = $sFile . '@custom'; + } } + \closedir($rDirH); + } else { + $this->logWrite("{$sDir} not readable", \LOG_DEBUG, 'Themes'); } - \closedir($rDirH); } if (\class_exists('OC', false)) {