Nicely exit in case of an early PHP type crash
Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
parent
6b35829406
commit
4ce69f3a3d
@ -111,8 +111,12 @@ class Header
|
||||
$this->bodyId = '';
|
||||
$this->title = '';
|
||||
$this->console = new Console();
|
||||
$this->menu = new Menu($dbi, $db ?? '', $table ?? '');
|
||||
$this->menuEnabled = true;
|
||||
$this->menuEnabled = false;
|
||||
if ($dbi !== null) {
|
||||
$this->menuEnabled = true;
|
||||
$this->menu = new Menu($dbi, $db ?? '', $table ?? '');
|
||||
}
|
||||
|
||||
$this->warningsEnabled = true;
|
||||
$this->scripts = new Scripts();
|
||||
$this->addDefaultScripts();
|
||||
@ -191,8 +195,8 @@ class Header
|
||||
'LoginCookieValidity' => $GLOBALS['cfg']['LoginCookieValidity'],
|
||||
'session_gc_maxlifetime' => (int) ini_get('session.gc_maxlifetime'),
|
||||
'logged_in' => isset($dbi) ? $dbi->isConnected() : false,
|
||||
'is_https' => $GLOBALS['config']->isHttps(),
|
||||
'rootPath' => $GLOBALS['config']->getRootPath(),
|
||||
'is_https' => $GLOBALS['config'] !== null && $GLOBALS['config']->isHttps(),
|
||||
'rootPath' => $GLOBALS['config'] !== null && $GLOBALS['config']->getRootPath(),
|
||||
'arg_separator' => Url::getArgSeparator(),
|
||||
'version' => Version::VERSION,
|
||||
];
|
||||
|
||||
@ -290,9 +290,16 @@ class ResponseRenderer
|
||||
// if its content was already rendered
|
||||
// and, in this case, the header will be
|
||||
// in the content part of the request
|
||||
$retval = $this->header->getDisplay();
|
||||
$retval = '';
|
||||
if ($this->header !== null) {
|
||||
$retval .= $this->header->getDisplay();
|
||||
}
|
||||
|
||||
$retval .= $this->HTML;
|
||||
$retval .= $this->footer->getDisplay();
|
||||
|
||||
if ($this->footer !== null) {
|
||||
$retval .= $this->footer->getDisplay();
|
||||
}
|
||||
|
||||
return $retval;
|
||||
}
|
||||
|
||||
@ -249,7 +249,7 @@ class Url
|
||||
|
||||
$separator = self::getArgSeparator();
|
||||
|
||||
if (! $encrypt || ! $config->get('URLQueryEncryption')) {
|
||||
if (! $encrypt || $config === null || ! $config->get('URLQueryEncryption')) {
|
||||
return http_build_query($params, '', $separator);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user