diff --git a/ChangeLog b/ChangeLog index c5f0ac86c5..c73cc22c6e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -50,6 +50,7 @@ phpMyAdmin - ChangeLog - issue #15863 Fixed designer move menu icon not changing directions and tables menu list resize button - issue #15854 Fixed black borders for full screen mode on Designer - issue #15899 Fix "Uncaught TypeError: mb_strtoupper()" on the relational view of a view +- issue Fixed some php uncaught errors and notices on user missing extension 5.0.1 (2020-01-07) - issue #15719 Fixed error 500 when browsing a table when $cfg['LimitChars'] used a string and not an int value diff --git a/libraries/classes/Core.php b/libraries/classes/Core.php index 3cea2dde9c..40ca72ea63 100644 --- a/libraries/classes/Core.php +++ b/libraries/classes/Core.php @@ -326,7 +326,7 @@ class Core ]; $lang = 'en'; - if (in_array($GLOBALS['lang'], $php_doc_languages)) { + if (isset($GLOBALS['lang']) && in_array($GLOBALS['lang'], $php_doc_languages)) { $lang = $GLOBALS['lang']; } @@ -345,6 +345,9 @@ class Core bool $fatal = false, string $extra = '' ): void { + /** @var ErrorHandler $error_handler */ + global $error_handler; + /* Gettext does not have to be loaded yet here */ if (function_exists('__')) { $message = __( @@ -367,11 +370,11 @@ class Core return; } - $GLOBALS['error_handler']->addError( + $error_handler->addError( $message, E_USER_WARNING, '', - '', + 0, false ); } diff --git a/libraries/classes/Template.php b/libraries/classes/Template.php index de10a82485..10093810b4 100644 --- a/libraries/classes/Template.php +++ b/libraries/classes/Template.php @@ -55,11 +55,11 @@ class Template { global $cfg; - /** @var Config $config */ + /** @var Config|null $config */ $config = $GLOBALS['PMA_Config']; if (static::$twig === null) { $loader = new FilesystemLoader(self::BASE_PATH); - $cache_dir = $config->getTempDir('twig'); + $cache_dir = $config !== null ? $config->getTempDir('twig') : null; /* Twig expects false when cache is not configured */ if ($cache_dir === null) { $cache_dir = false; diff --git a/libraries/classes/Url.php b/libraries/classes/Url.php index 765e048679..18e0852468 100644 --- a/libraries/classes/Url.php +++ b/libraries/classes/Url.php @@ -220,7 +220,9 @@ class Url $params['server'] = $GLOBALS['server']; } - if (empty($PMA_Config->getCookie('pma_lang')) && ! empty($GLOBALS['lang'])) { + // Can be null when the user is missing an extension. + // See: Core::checkExtensions() + if ($PMA_Config !== null && empty($PMA_Config->getCookie('pma_lang')) && ! empty($GLOBALS['lang'])) { $params['lang'] = $GLOBALS['lang']; }