From 9e7b71f977316c0066b1bc4cf9785510e97f372e Mon Sep 17 00:00:00 2001 From: Thijs Kinkhorst <thijs@kinkhorst.com> Date: Tue, 31 Aug 2021 08:20:59 +0000 Subject: [PATCH] Make warning more specific when specified theme or locale does not exist --- lib/SimpleSAML/Locale/Localization.php | 2 +- lib/SimpleSAML/XHTML/Template.php | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/SimpleSAML/Locale/Localization.php b/lib/SimpleSAML/Locale/Localization.php index 21c606062..ae621c2cf 100644 --- a/lib/SimpleSAML/Locale/Localization.php +++ b/lib/SimpleSAML/Locale/Localization.php @@ -206,7 +206,7 @@ class Localization } // Locale for default language missing even, error out - $error = "Localization directory missing/broken for langcode '$langcode' and domain '$domain'"; + $error = "Localization directory '$langPath' missing/broken for langcode '$langcode' and domain '$domain'"; Logger::critical($_SERVER['PHP_SELF'] . ' - ' . $error); throw new \Exception($error); } diff --git a/lib/SimpleSAML/XHTML/Template.php b/lib/SimpleSAML/XHTML/Template.php index e75907e63..f9df3c72c 100644 --- a/lib/SimpleSAML/XHTML/Template.php +++ b/lib/SimpleSAML/XHTML/Template.php @@ -351,11 +351,9 @@ class Template extends Response // setup directories & namespaces $themeDir = Module::getModuleDir($this->theme['module']) . '/themes/' . $this->theme['name']; - $subdirs = scandir($themeDir); + $subdirs = @scandir($themeDir); if (empty($subdirs)) { - // no subdirectories in the theme directory, nothing to do here - // this is probably wrong, log a message - Logger::warning('Empty theme directory for theme "' . $this->theme['name'] . '".'); + Logger::warning('Theme directory for theme "' . $this->theme['name'] . '" (' . $themeDir . ') is not readable or is empty.'); return []; } -- GitLab