PMA_getPHPDocLink can be used from fatal errors early in execution, where gettext is not yet loaded

This commit is contained in:
Michal Čihař
2011-10-18 12:41:42 +02:00
parent 3fa0b1f639
commit 75d1dce908

View File

@@ -260,8 +260,13 @@ function PMA_fatalError($error_message, $message_args = null)
* @access public
*/
function PMA_getPHPDocLink($target) {
/* 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);
}