projects
/
fa-stable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed get_post() support for numeric fields.
[fa-stable.git]
/
includes
/
errors.inc
diff --git
a/includes/errors.inc
b/includes/errors.inc
index 2a1aedd9f9138afdd4ab5bd79c37fa67fbe1191a..53587df6ed081b1489e162d77898d474e48f3ed6 100644
(file)
--- a/
includes/errors.inc
+++ b/
includes/errors.inc
@@
-21,7
+21,8
@@
function get_backtrace($html = false, $skip=0)
foreach($trace as $trn => $tr) {
if ($trn <= $skip) continue;
if ($html) $str .= '<tr><td>';
foreach($trace as $trn => $tr) {
if ($trn <= $skip) continue;
if ($html) $str .= '<tr><td>';
- $str .= $tr['file'].':'.$tr['line'].': ';
+ if (isset($tr['file']) && isset($tr['line']))
+ $str .= $tr['file'].':'.$tr['line'].': ';
if ($html) $str .= '</td><td>';
if (isset($tr['type'])) {
if($tr['type'] == '::') {
if ($html) $str .= '</td><td>';
if (isset($tr['type'])) {
if($tr['type'] == '::') {
@@
-32,7
+33,7
@@
function get_backtrace($html = false, $skip=0)
}
$str .= $tr['function'].'(';
}
$str .= $tr['function'].'(';
- if(is_array($tr['args'])) {
+ if(is
set($tr['args']) && is
_array($tr['args'])) {
$args = array();
foreach($tr['args'] as $n=>$a) {
if (is_object($tr['args'][$n]))
$args = array();
foreach($tr['args'] as $n=>$a) {
if (is_object($tr['args'][$n]))
@@
-71,7
+72,7
@@
function error_handler($errno, $errstr, $file, $line) {
}
}
}
}
- $bt = $SysPrefs->go_debug>1 ? get_backtrace(true, 1) : array();
+ $bt =
isset($SysPrefs) &&
$SysPrefs->go_debug>1 ? get_backtrace(true, 1) : array();
// error_reporting==0 when messages are set off with @
if ($errno & error_reporting()) {
// error_reporting==0 when messages are set off with @
if ($errno & error_reporting()) {
@@
-87,6
+88,13
@@
function error_handler($errno, $errstr, $file, $line) {
return true;
}
return true;
}
+
+function exception_handler($exception)
+{
+ error_handler(E_ERROR, sprintf(_("Unhandled exception [%s]: %s."), $exception->getCode(), $exception->getMessage()),
+ $exception->getFile(), $exception->getLine());
+ end_page();
+}
//------------------------------------------------------------------------------
// Formats system messages before insert them into message <div>
// FIX center is unused now
//------------------------------------------------------------------------------
// Formats system messages before insert them into message <div>
// FIX center is unused now