From 75d1dce908264a0040900fa0ed0080df90749860 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 18 Oct 2011 12:41:42 +0200 Subject: [PATCH] PMA_getPHPDocLink can be used from fatal errors early in execution, where gettext is not yet loaded --- libraries/core.lib.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libraries/core.lib.php b/libraries/core.lib.php index 9166dc490..84bca7b6d 100644 --- a/libraries/core.lib.php +++ b/libraries/core.lib.php @@ -260,8 +260,13 @@ function PMA_fatalError($error_message, $message_args = null) * @access public */ function PMA_getPHPDocLink($target) { - /* l10n: Language to use for PHP documentation, please use only languages which do exist in official documentation. */ - $lang = _pgettext('PHP documentation language', 'en'); + /* Gettext does not have to be loaded yet */ + if (function_exists('_pgettext')) { + /* l10n: Language to use for PHP documentation, please use only languages which do exist in official documentation. */ + $lang = _pgettext('PHP documentation language', 'en'); + } else { + $lang = 'en'; + } return PMA_linkURL('http://php.net/manual/' . $lang . '/' . $target); }