From 84cd7fb4b5efbfbd8898df2042d1e6954e20674d Mon Sep 17 00:00:00 2001 From: William Desportes Date: Sun, 9 Feb 2020 16:12:28 +0100 Subject: [PATCH 1/4] Fix some php "Uncaught Error" when user is missing an extension Signed-off-by: William Desportes --- libraries/classes/Template.php | 2 +- libraries/classes/Url.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libraries/classes/Template.php b/libraries/classes/Template.php index 3866fd2954..73e3aeb341 100644 --- a/libraries/classes/Template.php +++ b/libraries/classes/Template.php @@ -63,7 +63,7 @@ class Template $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 aeae50a34f..b9bd013425 100644 --- a/libraries/classes/Url.php +++ b/libraries/classes/Url.php @@ -216,7 +216,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']; } From ed48153e7b73a90a902138a2e33c9ab2ac312d20 Mon Sep 17 00:00:00 2001 From: William Desportes Date: Sun, 9 Feb 2020 16:23:56 +0100 Subject: [PATCH 2/4] Fix Uncaught TypeError: Argument 4 passed to PhpMyAdmin\ErrorHandler::addError() must be of the type int Uncaught TypeError: Argument 4 passed to PhpMyAdmin\ErrorHandler::addError() must be of the type int Signed-off-by: William Desportes --- libraries/classes/Core.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libraries/classes/Core.php b/libraries/classes/Core.php index 581afbc9ef..2b17fcc0ad 100644 --- a/libraries/classes/Core.php +++ b/libraries/classes/Core.php @@ -352,6 +352,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 = __( @@ -374,11 +377,11 @@ class Core return; } - $GLOBALS['error_handler']->addError( + $error_handler->addError( $message, E_USER_WARNING, '', - '', + 0, false ); } From 612e501086aa0ba00d5145ea2264c6cce3ad0c5f Mon Sep 17 00:00:00 2001 From: William Desportes Date: Sun, 9 Feb 2020 16:25:03 +0100 Subject: [PATCH 3/4] Fix php notice when global lang does not exist Signed-off-by: William Desportes --- libraries/classes/Core.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/classes/Core.php b/libraries/classes/Core.php index 2b17fcc0ad..5a7ee91e23 100644 --- a/libraries/classes/Core.php +++ b/libraries/classes/Core.php @@ -331,7 +331,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']; } From e7eac68a964cc288c959a0d9c1f4e09232f5b176 Mon Sep 17 00:00:00 2001 From: William Desportes Date: Sun, 9 Feb 2020 16:27:42 +0100 Subject: [PATCH 4/4] Add ChangeLog entry for ed48153e7b and 612e501086 Signed-off-by: William Desportes --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index c8126fd8e8..89c50be789 100644 --- a/ChangeLog +++ b/ChangeLog @@ -33,6 +33,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