From 346523fad6f96b673e7acf67e741a3f6af217a84 Mon Sep 17 00:00:00 2001 From: Christian Schnegelberger Date: Sat, 23 Sep 2023 18:20:29 +0200 Subject: [PATCH 1/2] [ticket/17113] Write icon_id to split topic's posts PHPBB3-17113 --- phpBB/includes/mcp/mcp_topic.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index 953ec95af1..5e50ccf985 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -638,9 +638,10 @@ function split_topic($action, $topic_id, $to_forum_id, $subject) $topic_info['topic_title'] )); - // Change topic title of first post + // Change topic title of first post and write icon_id to post $sql = 'UPDATE ' . POSTS_TABLE . " - SET post_subject = '" . $db->sql_escape($subject) . "' + SET post_subject = '" . $db->sql_escape($subject) . "', + icon_id = '" . $icon_id . "' WHERE post_id = {$post_id_list[0]}"; $db->sql_query($sql); From 745dd5f5a84b735e32106fe27c34a92a73732126 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 27 Sep 2023 22:03:17 +0200 Subject: [PATCH 2/2] [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);