From ed88c4a7b68c8efd764a364d1a9579aa762ebdaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Sun, 10 Jul 2011 22:46:46 +0200 Subject: [PATCH] Fix error when gettext is not yet loaded and we want to warn. This happens when PHP is compiled without session support, which is checked before gettext is loaded. --- libraries/core.lib.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libraries/core.lib.php b/libraries/core.lib.php index 1350247ae..80c1f1204 100644 --- a/libraries/core.lib.php +++ b/libraries/core.lib.php @@ -275,7 +275,13 @@ function PMA_getPHPDocLink($target) { */ function PMA_warnMissingExtension($extension, $fatal = false, $extra = '') { - $message = sprintf(__('The %s extension is missing. Please check your PHP configuration.'), + /* Gettext does not have to be loaded yet here */ + if (function_exists('__')) { + $message = __('The %s extension is missing. Please check your PHP configuration.'); + } else { + $message = 'The %s extension is missing. Please check your PHP configuration.'; + } + $message = sprintf($message, '[a@' . PMA_getPHPDocLink('book.' . $extension . '.php') . '@Documentation][em]' . $extension . '[/em][/a]'); if ($extra != '') { $message .= ' ' . $extra;