Closed (duplicate)
Project:
Drupal core
Version:
5.9
Component:
forum.module
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Oct 2009 at 21:32 UTC
Updated:
15 Oct 2009 at 02:46 UTC
When viewing forum page with nonexistent TID, or TID from another vocabulary, forum_page continuing to output forum listing page, instead of 404 page. This happening due to missing validation of $tid in forum_page. This affect both drupal 5.x and drupal 6.x versions.
My solution is to add this code to forum_page function, right after $tid = (int)$tid;
$term = taxonomy_get_term($tid);
$forum_nav_vocabulary = variable_get('forum_nav_vocabulary', '');
// Check if this is a valid term.
if (!$term or $term->vid != $forum_nav_vocabulary) {
return drupal_not_found();
}
This can get very messy, aseptically, if you are using pathauto module to generate aliases like forum/2009/10/13/page-title-or-nid.
Comments
Comment #1
michelleDuplicate of #513618: Taxonomy term mimics forum display when it shouldn't
Michelle