From 8a612429b2a89a038c57afd61f582f57a2a7a64f Mon Sep 17 00:00:00 2001 From: slawkens Date: Thu, 9 Jan 2025 13:03:55 +0100 Subject: [PATCH] Use $db->insert instead of manual query --- system/pages/forum/new_thread.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/system/pages/forum/new_thread.php b/system/pages/forum/new_thread.php index d10e7a11..e6c8fe80 100644 --- a/system/pages/forum/new_thread.php +++ b/system/pages/forum/new_thread.php @@ -95,7 +95,23 @@ if(Forum::canPost($account_logged)) { if (count($errors) == 0) { $saved = true; - $db->query("INSERT INTO `" . FORUM_TABLE_PREFIX . "forum` (`first_post` ,`last_post` ,`section` ,`replies` ,`views` ,`author_aid` ,`author_guid` ,`post_text` ,`post_topic` ,`post_smile`, `post_html` ,`post_date` ,`last_edit_aid` ,`edit_date`, `post_ip`) VALUES ('0', '" . time() . "', '" . (int)$section_id . "', '0', '0', '" . $account_logged->getId() . "', '" . $char_id . "', " . $db->quote($text) . ", " . $db->quote($post_topic) . ", '" . $smile . "', '" . $html . "', '" . time() . "', '0', '0', '" . get_browser_real_ip() . "')"); + $db->insert(FORUM_TABLE_PREFIX . 'forum', [ + 'first_post' => 0, + 'last_post' => time(), + 'section' => $section_id, + 'replies' => 0, + 'views' => 0, + 'author_aid' => $account_logged->getId(), + 'author_guid' => $char_id, + 'post_text' => $text, + 'post_topic' => $post_topic, + 'post_smile' => $smile, + 'post_html' => $html, + 'post_date' => time(), + 'last_edit_aid' => 0, + 'edit_date' => 0, + 'post_ip' => get_browser_real_ip(), + ]); $thread_id = $db->lastInsertId();