X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fsession.inc;h=a08344aea10fad53ead55414cd55cf64cf7359e5;hb=31629799f984d0237fe73f366d3d3d75448f1f34;hp=026ad125a321fcd3ecf40392aa8b4c3cb4803038;hpb=463ab9029b1efa51c96aca12aa8537d262fe6f82;p=fa-stable.git diff --git a/includes/session.inc b/includes/session.inc index 026ad125..a08344ae 100644 --- a/includes/session.inc +++ b/includes/session.inc @@ -9,13 +9,21 @@ | by Joe Hunt Consulting | \--------------------------------------------------*/ - function output_html($text) + function output_html($text) { - global $before_box; + global $before_box, $Ajax, $messages; + // Fatal errors are not send to error_handler, + // so we must check the output + if ($text && preg_match('/\bFatal error(<.*?>)?:(.*)/i', $text, $m)) { + $Ajax->aCommands = array(); // Don't update page via ajax on errors + $text = preg_replace('/\bFatal error(<.*?>)?:(.*)/i','', $text); + $messages[] = array(E_ERROR, $m[2], null, null); + } + $Ajax->run(); return in_ajax() ? fmt_errors() : ($before_box.fmt_errors().$text); } - if (!isset($path_to_root)) + if (!isset($path_to_root)) { $path_to_root = "."; } @@ -48,7 +56,7 @@ //---------------------------------------------------------------------------------------- - function kill_login() + function kill_login() { session_unset(); session_destroy(); @@ -56,7 +64,7 @@ //---------------------------------------------------------------------------------------- - function login_fail() + function login_fail() { echo "