add sql-query of last statement to sql-debug for debugging purposes; fix default-ssl-ip setting and allow 'none' value

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2018-02-21 12:16:50 +01:00
parent 5480fcbf5d
commit b56414ed0e
5 changed files with 29 additions and 12 deletions

View File

@@ -71,7 +71,7 @@ class Database {
try {
$stmt->execute($params);
} catch (PDOException $e) {
self::_showerror($e, $showerror, $json_response);
self::_showerror($e, $showerror, $json_response, $stmt);
}
}
@@ -309,7 +309,7 @@ class Database {
* @param PDOException $error
* @param bool $showerror if set to false, the error will be logged but we go on
*/
private static function _showerror($error, $showerror = true, $json_response = false) {
private static function _showerror($error, $showerror = true, $json_response = false, PDOStatement $stmt = null) {
global $userinfo, $theme, $linker;
// include userdata.inc.php
@@ -374,6 +374,8 @@ class Database {
if ($showerror) {
if (empty($sql['debug'])) {
$error_trace = '';
} elseif (!is_null($stmt)) {
$error_trace .= "<br><br>".$stmt->queryString;
}
// fallback