Skip to content

Commit

Permalink
Fix error when gettext is not yet loaded and we want to warn.
Browse files Browse the repository at this point in the history
This happens when PHP is compiled without session support, which is
checked before gettext is loaded.
  • Loading branch information
nijel committed Jul 10, 2011
1 parent 58d25dd commit ed88c4a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion libraries/core.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ed88c4a

Please sign in to comment.