From: Janusz Dobrowolski Date: Thu, 24 Jul 2008 21:13:57 +0000 (+0000) Subject: Ajax runtime fatal error handling added [0000003] X-Git-Tag: v2.4.2~19^2~1890 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=386cc7beabdf05e3ca604cca32a4dad44f5d6dc8;p=fa-stable.git Ajax runtime fatal error handling added [0000003] --- diff --git a/includes/session.inc b/includes/session.inc index 0354221d..34e01cd2 100644 --- a/includes/session.inc +++ b/includes/session.inc @@ -11,7 +11,14 @@ function output_html($text) { - global $before_box, $Ajax; + 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 on errors + + $messages[] = array(E_ERROR, $m[0], null, null); + } $Ajax->run(); return in_ajax() ? fmt_errors() : ($before_box.fmt_errors().$text); }