Skip to content

Commit

Permalink
Fix some php "Uncaught Error" when user is missing an extension
Browse files Browse the repository at this point in the history
Signed-off-by: William Desportes <williamdes@wdes.fr>
  • Loading branch information
williamdes committed Feb 9, 2020
1 parent df55e04 commit 84cd7fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libraries/classes/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function __construct()
$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;
Expand Down
4 changes: 3 additions & 1 deletion libraries/classes/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,9 @@ public static function getCommonRaw($params = [], $divider = '?')
$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'];
}

Expand Down

0 comments on commit 84cd7fb

Please sign in to comment.