Commit 6fb12172 by pupi1985

Minor refactoring of qa_db_fail_error

parent dd800b30
...@@ -108,13 +108,15 @@ ...@@ -108,13 +108,15 @@
global $qa_db_fail_handler; global $qa_db_fail_handler;
@error_log('PHP Question2Answer MySQL '.$type.' error '.$errno.': '.$error.(isset($query) ? (' - Query: '.$query) : '')); @error_log('PHP Question2Answer MySQL ' . $type . ' error ' . $errno . ': ' . $error . (isset($query) ? (' - Query: ' . $query) : ''));
if (function_exists($qa_db_fail_handler)) if (function_exists($qa_db_fail_handler))
$qa_db_fail_handler($type, $errno, $error, $query); $qa_db_fail_handler($type, $errno, $error, $query);
else { else {
echo '<hr><font color="red">Database '.htmlspecialchars($type.' error '.$errno).'<p>'.nl2br(htmlspecialchars($error."\n\n".$query)); echo sprintf(
'<hr><div style="color: red">Database %s<p>%s</p><code>%s</code></div>',
htmlspecialchars($type . ' error ' . $errno), nl2br(htmlspecialchars($error)), nl2br(htmlspecialchars($query))
);
qa_exit('error'); qa_exit('error');
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment