From 534ffeaf39defa79d62917611beb0afaaa2f08e9 Mon Sep 17 00:00:00 2001 From: albertlast Date: Sat, 8 Aug 2026 23:07:34 +0200 Subject: [PATCH] Says which board when merge topics is asked without one ?action=mergetopics without a board in the URL is an HTTP 500: Typed static property SMF\Board::$info must not be accessed before initialization Sources/Actions/TopicMerge.php:240 index() reads Board::$info in three places - to default the target board, to build the page index, and to look the source topic up in the current board - and the whole method is written around there being one. Board::$info is typed with no default, so without a board none of those reads work, and the first one takes the request down with an uncaught error rather than a message. The merge button in a topic always includes board=, so this is reached by editing the URL rather than by using the forum. It should still say what is wrong: it now stops at the top with no_board, the same string the method already uses further down when the source topic is not in this board. Signed-off-by: Mathias Papenbrock Signed-off-by: albertlast --- Sources/Actions/TopicMerge.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Sources/Actions/TopicMerge.php b/Sources/Actions/TopicMerge.php index 29043841a3c..21f924bc965 100644 --- a/Sources/Actions/TopicMerge.php +++ b/Sources/Actions/TopicMerge.php @@ -208,6 +208,14 @@ public function index(): void ErrorHandler::fatalLang('no_access', false); } + // Everything below looks for the source topic in the current board, and + // pages the target list relative to it, so there has to be one. + // Board::$info is typed with no default, so reading it without a board + // is an uncaught error rather than an empty value. + if (!isset(Board::$info)) { + ErrorHandler::fatalLang('no_board', false); + } + $_GET['from'] = (int) $_GET['from']; $_REQUEST['targetboard'] = isset($_REQUEST['targetboard']) ? (int) $_REQUEST['targetboard'] : Board::$info->id;