From 745dd5f5a84b735e32106fe27c34a92a73732126 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 27 Sep 2023 22:03:17 +0200 Subject: [PATCH] [ticket/17113] Usq sql_build_array() for cleaner code PHPBB3-17113 --- phpBB/includes/mcp/mcp_topic.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index 5e50ccf985..8bb7260c97 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -639,9 +639,12 @@ function split_topic($action, $topic_id, $to_forum_id, $subject) )); // Change topic title of first post and write icon_id to post - $sql = 'UPDATE ' . POSTS_TABLE . " - SET post_subject = '" . $db->sql_escape($subject) . "', - icon_id = '" . $icon_id . "' + $sql_ary = [ + 'post_subject' => $subject, + 'icon_id' => $icon_id, + ]; + $sql = 'UPDATE ' . POSTS_TABLE . ' + SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " WHERE post_id = {$post_id_list[0]}"; $db->sql_query($sql);