From 7ba44d3530cbf63e3a583a78e2cfbc56bb79c3a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 1 Nov 2012 09:11:14 +0100 Subject: [PATCH] Define fake __ function in case of gettext is not loaded for fatal error --- libraries/core.lib.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libraries/core.lib.php b/libraries/core.lib.php index 47de1fdddf..d0f218b041 100644 --- a/libraries/core.lib.php +++ b/libraries/core.lib.php @@ -220,12 +220,13 @@ function PMA_fatalError( } else { $error_message = strtr($error_message, array('
' => '[br]')); - if (function_exists('__')) { - $error_header = __('Error'); - } else { - $error_header = 'Error'; + /* Define fake gettext for fatal errors */ + if (!function_exists('__')) { + function __($text) { return $text; } } + $error_header = __('Error'); + $lang = $GLOBALS['available_languages'][$GLOBALS['lang']][1]; $dir = $GLOBALS['text_dir'];