fix: address code review feedback on billing admin fixes

- menu.php: remove unnecessary @ suppression from mysqli_thread_id()
  (instanceof check already guarantees a mysqli object)
- adminserverlist.php: split ternary flash message into separate if/else
  for readability; replace dynamic SQL fragment with explicit if/else
  query branches

Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/988997ed-7568-48bf-96ef-889fb5d91fec

Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-05-02 13:41:13 +00:00 committed by GitHub
parent bb77620796
commit f4f222953f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 6 deletions

View file

@ -56,8 +56,9 @@ if ($is_logged_in) {
$menu_db = null;
$menu_db_opened = false;
// Only reuse $db if it is still an open (non-closed) connection.
// mysqli_thread_id() returns 0 on a closed handle, so guard against that.
if (isset($db) && $db instanceof mysqli && @mysqli_thread_id($db)) {
// mysqli_thread_id() returns 0 on a closed handle; no @ needed since instanceof
// already guarantees $db is a mysqli object.
if (isset($db) && $db instanceof mysqli && mysqli_thread_id($db)) {
$menu_db = $db;
} else {
$menu_db_port = isset($db_port) ? (int)$db_port : null;