diff --git a/CHANGELOG.md b/CHANGELOG.md index 99f1a83f2..30f2da602 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ - Show poll prefix for guests [\#1417](https://github.com/torrentpier/torrentpier/pull/1417) ([belomaxorka](https://github.com/belomaxorka)) - Used hashing for filenames generation [\#1385](https://github.com/torrentpier/torrentpier/pull/1385) ([belomaxorka](https://github.com/belomaxorka)) - Hide quote button if topic locked [\#1416](https://github.com/torrentpier/torrentpier/pull/1416) ([belomaxorka](https://github.com/belomaxorka)) +- log_error(): Hide Referer string if empty [\#1430](https://github.com/torrentpier/torrentpier/pull/1430) ([belomaxorka](https://github.com/belomaxorka)) - Minor improvements [\#1382](https://github.com/torrentpier/torrentpier/pull/1382), [\#1383](https://github.com/torrentpier/torrentpier/pull/1383), [\#1391](https://github.com/torrentpier/torrentpier/pull/1391), [\#1398](https://github.com/torrentpier/torrentpier/pull/1398), [\#1405](https://github.com/torrentpier/torrentpier/pull/1405), [\#1406](https://github.com/torrentpier/torrentpier/pull/1406), [\#1408](https://github.com/torrentpier/torrentpier/pull/1408), [\#1409](https://github.com/torrentpier/torrentpier/pull/1409), [\#1410](https://github.com/torrentpier/torrentpier/pull/1410), [\#1411](https://github.com/torrentpier/torrentpier/pull/1411), [\#1418](https://github.com/torrentpier/torrentpier/pull/1418), [\#1422](https://github.com/torrentpier/torrentpier/pull/1422) ([belomaxorka](https://github.com/belomaxorka)) - Some bugfixes [\#1380](https://github.com/torrentpier/torrentpier/pull/1380) ([belomaxorka](https://github.com/belomaxorka)) - Updated deps [\#1414](https://github.com/torrentpier/torrentpier/pull/1414), [\#1415](https://github.com/torrentpier/torrentpier/pull/1415), [\#1421](https://github.com/torrentpier/torrentpier/pull/1421), [\#1424](https://github.com/torrentpier/torrentpier/pull/1424) ([belomaxorka](https://github.com/belomaxorka)) diff --git a/src/Legacy/SqlDb.php b/src/Legacy/SqlDb.php index 70bd6176a..a65b5fd7b 100644 --- a/src/Legacy/SqlDb.php +++ b/src/Legacy/SqlDb.php @@ -927,14 +927,18 @@ class SqlDb $err = $this->sql_error(); $msg[] = str_compact(sprintf('#%06d %s', $err['code'], $err['message'])); $msg[] = ''; - $msg[] = str_compact($this->cur_query); + if (!empty($this->cur_query)) { + $msg[] = str_compact($this->cur_query); + } $msg[] = ''; $msg[] = 'Source : ' . $this->debug_find_source() . " :: $this->db_server.$this->selected_db"; $msg[] = 'IP : ' . @$_SERVER['REMOTE_ADDR']; $msg[] = 'Date : ' . date('Y-m-d H:i:s'); $msg[] = 'Agent : ' . @$_SERVER['HTTP_USER_AGENT']; $msg[] = 'Req_URI : ' . @$_SERVER['REQUEST_URI']; - $msg[] = 'Referer : ' . @$_SERVER['HTTP_REFERER']; + if (!empty($_SERVER['HTTP_REFERER'])) { + $msg[] = 'Referer : ' . $_SERVER['HTTP_REFERER']; + } $msg[] = 'Method : ' . @$_SERVER['REQUEST_METHOD']; $msg[] = 'PID : ' . sprintf('%05d', getmypid()); $msg[] = 'Request : ' . trim(print_r($_REQUEST, true)) . str_repeat('_', 78) . LOG_LF;