From ac6b26be46844a5f13d06b001839fbf734b22ce4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Pe=CC=81rez?= <jaime.perez@uninett.no> Date: Tue, 4 Oct 2016 16:32:13 +0200 Subject: [PATCH] Use \SimpleSAML\Logger in the new Localization class, and fix general Exception being called from a namespace. --- lib/SimpleSAML/Locale/Localization.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/SimpleSAML/Locale/Localization.php b/lib/SimpleSAML/Locale/Localization.php index e11a56c3a..44b277955 100644 --- a/lib/SimpleSAML/Locale/Localization.php +++ b/lib/SimpleSAML/Locale/Localization.php @@ -110,16 +110,17 @@ class Localization $langPath = $localeDir.'/'.$defLangcode.'/LC_MESSAGES/'; if (is_dir($langPath) && is_readable($langPath)) { // Report that the localization for the preferred language is missing - $error = "Localization not found for langcode '$langcode' at '$langPath', falling back to langcode '$defLangcode'"; - \SimpleSAML_Logger::error($_SERVER['PHP_SELF'].' - '.$error); + $error = "Localization not found for langcode '$langcode' at '$langPath', falling back to langcode '". + $defLangcode."'"; + \SimpleSAML\Logger::error($_SERVER['PHP_SELF'].' - '.$error); return $langPath; } // Locale for default language missing even, error out $error = "Localization directory missing/broken for langcode '$langcode' and domain '$domain'"; - \SimpleSAML_Logger::critical($_SERVER['PHP_SELF'].' - '.$error); - throw new Exception($error); + \SimpleSAML\Logger::critical($_SERVER['PHP_SELF'].' - '.$error); + throw new \Exception($error); } @@ -144,7 +145,7 @@ class Localization $t->loadTranslations($translations); } else { $error = "Localization file '$poFile' not found in '$langPath', falling back to default"; - \SimpleSAML_Logger::error($_SERVER['PHP_SELF'].' - '.$error); + \SimpleSAML\Logger::error($_SERVER['PHP_SELF'].' - '.$error); } } -- GitLab