remove static copyright-year in templates; fix possible undefined theme-variable in phpErrHandler by specifying a fallback-default
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -364,6 +364,7 @@ class Database {
|
||||
// replace values
|
||||
$err_hint = str_replace("<TEXT>", $error_message, $err_hint);
|
||||
$err_hint = str_replace("<DEBUG>", $error_trace, $err_hint);
|
||||
$err_hint = str_replace("<CURRENT_YEAR>", date('Y', time()), $err_hint);
|
||||
|
||||
$err_report_html = '';
|
||||
if (is_array($userinfo) && (
|
||||
|
||||
@@ -20,6 +20,11 @@ function phpErrHandler($errno, $errstr, $errfile, $errline, array $errcontext) {
|
||||
|
||||
if (!isset($_SERVER['SHELL']) || (isset($_SERVER['SHELL']) && $_SERVER['SHELL'] == '')) {
|
||||
global $theme;
|
||||
|
||||
// fallback
|
||||
if (empty($theme)) {
|
||||
$theme = "Sparkle";
|
||||
}
|
||||
// if we're not on the shell, output a nicer error-message
|
||||
$err_hint = file_get_contents(FROXLOR_INSTALL_DIR.'/templates/'.$theme.'/misc/phperrornice.tpl');
|
||||
// replace values
|
||||
|
||||
@@ -78,6 +78,7 @@ define('FROXLOR_INSTALL_DIR', dirname(dirname(__FILE__)));
|
||||
// check whether the userdata file exists
|
||||
if (!file_exists(FROXLOR_INSTALL_DIR.'/lib/userdata.inc.php')) {
|
||||
$config_hint = file_get_contents(FROXLOR_INSTALL_DIR.'/templates/'.$_deftheme.'/misc/configurehint.tpl');
|
||||
$config_hint = str_replace("<CURRENT_YEAR>", date('Y', time()), $config_hint);
|
||||
die($config_hint);
|
||||
}
|
||||
|
||||
@@ -92,6 +93,7 @@ if (!is_readable(FROXLOR_INSTALL_DIR.'/lib/userdata.inc.php')) {
|
||||
$owner_hint = str_replace("<USER>", $posixusername['name'], $owner_hint);
|
||||
$owner_hint = str_replace("<GROUP>", $posixgroup['name'], $owner_hint);
|
||||
$owner_hint = str_replace("<FROXLOR_INSTALL_DIR>", FROXLOR_INSTALL_DIR, $owner_hint);
|
||||
$owner_hint = str_replace("<CURRENT_YEAR>", date('Y', time()), $owner_hint);
|
||||
// show
|
||||
die($owner_hint);
|
||||
}
|
||||
@@ -105,6 +107,7 @@ if (!isset($sql)
|
||||
|| !is_array($sql)
|
||||
) {
|
||||
$config_hint = file_get_contents(FROXLOR_INSTALL_DIR.'/templates/'.$_deftheme.'/misc/configurehint.tpl');
|
||||
$config_hint = str_replace("<CURRENT_YEAR>", date('Y', time()), $config_hint);
|
||||
die($config_hint);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user