fix: null handling in realEscapeSingle, init $map, add billing upgrade for created_by_admin

Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/77c3c429-fc35-4f66-9d78-900be575b81a

Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-05-01 13:16:04 +00:00 committed by GitHub
parent 21b8dab91b
commit 8a6823186a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 2 deletions

View file

@ -73,7 +73,8 @@ class OGPDatabaseMySQL extends OGPDatabase
}
public function realEscapeSingle($string){
return mysqli_real_escape_string($this->link, $string);
if ($string === null) return '';
return mysqli_real_escape_string($this->link, (string)$string);
}
private function listQuery($query) {

View file

@ -25,7 +25,7 @@
// Module general information
$module_title = "billing";
$module_version = "3.0";
$db_version = 1;
$db_version = 2;
$module_required = FALSE;
// Module description
$module_description = "Billing storefront / provisioning integration. Public ordering runs as a standalone site; panel pages provide provisioning and admin order management.";
@ -125,4 +125,11 @@ $install_queries[0] = array(
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;"
);
// Version 2: Add created_by_admin column to billing_orders for existing installs
$install_queries[1] = array(
"ALTER TABLE `".OGP_DB_PREFIX."billing_orders`
ADD COLUMN IF NOT EXISTS `created_by_admin` TINYINT(1) NOT NULL DEFAULT 0
COMMENT 'Set to 1 when an admin manually created this server via the panel';"
);
?>

View file

@ -67,6 +67,7 @@ function exec_ogp_module()
$query_name = $mod; // If query name does not exist use mod key instead.
// Check if the screen running the server is running.
$map = '';
if ($server_xml->protocol == "gameq")
{
require('protocol/GameQ/functions.php');