From 2c4fc2d300df40d2435baa56fd31013dbcf4dbf1 Mon Sep 17 00:00:00 2001 From: sickprodigy Date: Sun, 16 Nov 2025 14:30:27 -0500 Subject: [PATCH] Add error handling for settings group creation in htmlposts_activate function --- Upload/inc/plugins/htmlposts.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Upload/inc/plugins/htmlposts.php b/Upload/inc/plugins/htmlposts.php index f6d8b7e..4cbfcc1 100644 --- a/Upload/inc/plugins/htmlposts.php +++ b/Upload/inc/plugins/htmlposts.php @@ -66,7 +66,12 @@ function htmlposts_activate() 'disporder' => 100, 'isdefault' => 0 ); - $gid = $db->insert_query("settinggroups", $insertarray); + $db->insert_query("settinggroups", $insertarray); + $gid = $db->insert_id(); + + if (!$gid || !is_numeric($gid)) { + die("Failed to create settings group. $gid is not valid."); + } // add settings $setting = array(