Skip to content

Commit 4c1df62

Browse files
committed
Fix topicAction routes
There was a duplicate in routes.php. The name of the topic was added in URL.
1 parent 5f7e21b commit 4c1df62

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

featherbb/Model/Forum.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ public function print_topics($forum_id, $sort_by, $start_from)
221221
$cur_topic['item_status'] .= ' inew';
222222
$cur_topic['icon_type'] = 'icon icon-new';
223223
$cur_topic['subject_formatted'] = '<strong>'.$cur_topic['subject_formatted'].'</strong>';
224-
$subject_new_posts = '<span class="newtext">[ <a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3C%2Fspan%3E%27%3C%2Fspan%3E.Router%3A%3A%3Cspan+class%3D"pl-en">pathFor('topicAction', ['id' => $cur_topic['id'], 'action' => 'new']).'" title="'.__('New posts info').'">'.__('New posts').'</a> ]</span>';
224+
$subject_new_posts = '<span class="newtext">[ <a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3C%2Fspan%3E%27%3C%2Fspan%3E.Router%3A%3A%3Cspan+class%3D"pl-en">pathFor('topicAction', ['id' => $cur_topic['id'], 'name' => $url_subject, 'action' => 'new']).'" title="'.__('New posts info').'">'.__('New posts').'</a> ]</span>';
225225
} else {
226226
$subject_new_posts = null;
227227
}

featherbb/Model/Search.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ public function display_search_results($search)
755755
$cur_search['item_status'] .= ' inew';
756756
$cur_search['icon_type'] = 'icon icon-new';
757757
$subject = '<strong>'.$subject.'</strong>';
758-
$subject_new_posts = '<span class="newtext">[ <a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3C%2Fspan%3E%27%3C%2Fspan%3E.Router%3A%3A%3Cspan+class%3D"pl-en">pathFor('topicAction', ['id' => $cur_search['tid'], 'action' => 'new']).'" title="'.__('New posts info').'">'.__('New posts').'</a> ]</span>';
758+
$subject_new_posts = '<span class="newtext">[ <a href="proxy.php?url=https%3A%2F%2Fgithub.com%2F%3C%2Fspan%3E%27%3C%2Fspan%3E.Router%3A%3A%3Cspan+class%3D"pl-en">pathFor('topicAction', ['id' => $cur_search['tid'], 'name' => $url_topic, 'action' => 'new']).'" title="'.__('New posts info').'">'.__('New posts').'</a> ]</span>';
759759
} else {
760760
$subject_new_posts = null;
761761
}

featherbb/routes.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
Route::get('/{id:[0-9]+}[/{name:[\w\-]+}]', '\FeatherBB\Controller\Topic:display')->setName('Topic');
3939
Route::get('/{id:[0-9]+}/{name:[\w\-]+}/page/{page:[0-9]+}', '\FeatherBB\Controller\Topic:display')->setName('TopicPaginate');
4040
Route::get('/{id:[0-9]+}/{name:[\w\-]+}/post/{pid:[0-9]+}', '\FeatherBB\Controller\Topic:viewpost')->setName('viewPost');
41-
Route::get('/{id:[0-9]+}/action/{action:[\w\-]+}', '\FeatherBB\Controller\Topic:action')->setName('topicAction');
41+
Route::get('/{id:[0-9]+}/{name:[\w\-]+}/action/{action:[\w\-]+}', '\FeatherBB\Controller\Topic:action')->setName('topicAction');
4242
Route::get('/subscribe/{id:[0-9]+}[/{name:[\w\-]+}]', '\FeatherBB\Controller\Topic:subscribe')->add(new IsLogged)->setName('subscribeTopic');
4343
Route::get('/unsubscribe/{id:[0-9]+}[/{name:[\w\-]+}]', '\FeatherBB\Controller\Topic:unsubscribe')->add(new IsLogged)->setName('unsubscribeTopic');
4444
Route::get('/close/{id:[0-9]+}[/{name:[\w\-]+}]', '\FeatherBB\Controller\Topic:close')->add(new IsAdmMod)->setName('closeTopic');
@@ -47,7 +47,6 @@
4747
Route::get('/unstick/{id:[0-9]+}[/{name:[\w\-]+}]', '\FeatherBB\Controller\Topic:unstick')->add(new IsAdmMod)->setName('unstickTopic');
4848
Route::map(['GET', 'POST'], '/move/{id:[0-9]+}[/{name:[\w\-]+}/forum/{fid:[0-9]+}]', '\FeatherBB\Controller\Topic:move')->add(new IsAdmMod)->setName('moveTopic');
4949
Route::map(['GET', 'POST'], '/moderate/{id:[0-9]+}/forum/{fid:[0-9]+}[/page/{page:[0-9]+}]', '\FeatherBB\Controller\Topic:moderate')->add(new IsAdmMod)->setName('moderateTopic');
50-
Route::get('/{id:[0-9]+}/action/{action}', '\FeatherBB\Controller\Topic{action}')->setName('topicAction');
5150
})->add(new CanReadBoard);
5251

5352
// Post routes

0 commit comments

Comments
 (0)