fatal_error now accept extra parameter for error message formating
This commit is contained in:
parent
6b20a4a526
commit
2c7689a43d
1 changed files with 8 additions and 0 deletions
|
@ -194,6 +194,14 @@ $ajax=false;
|
||||||
function fatal_error($error) {
|
function fatal_error($error) {
|
||||||
global $smarty, $ajax, $api_mode;
|
global $smarty, $ajax, $api_mode;
|
||||||
|
|
||||||
|
// If more than one arguments passed, format error message using sprintf
|
||||||
|
if (func_num_args() > 1) {
|
||||||
|
$error = call_user_func_array(
|
||||||
|
'sprintf',
|
||||||
|
array_merge(array($error), array_slice(func_get_args(), 1))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (php_sapi_name() == "cli")
|
if (php_sapi_name() == "cli")
|
||||||
die("FATAL ERROR : $error\n");
|
die("FATAL ERROR : $error\n");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue