Do not allow setting forums parent to the forum itself. (Bug #18855)

git-svn-id: file:///svn/phpbb/trunk@8871 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2008-09-18 13:22:15 +00:00
parent d135060c12
commit 76c0e5aa5e

View file

@ -921,10 +921,9 @@ class acp_forums
$range_test_ary = array( $range_test_ary = array(
array('lang' => 'FORUM_TOPICS_PAGE', 'value' => $forum_data['forum_topics_per_page'], 'column_type' => 'TINT:0'), array('lang' => 'FORUM_TOPICS_PAGE', 'value' => $forum_data['forum_topics_per_page'], 'column_type' => 'TINT:0'),
); );
validate_range($range_test_ary, $errors); validate_range($range_test_ary, $errors);
// Set forum flags // Set forum flags
// 1 = link tracking // 1 = link tracking
// 2 = prune old polls // 2 = prune old polls
@ -1204,9 +1203,16 @@ class acp_forums
} }
if ($row['parent_id'] != $forum_data_sql['parent_id']) if ($row['parent_id'] != $forum_data_sql['parent_id'])
{
if ($row['forum_id'] != $forum_data_sql['parent_id'])
{ {
$errors = $this->move_forum($forum_data_sql['forum_id'], $forum_data_sql['parent_id']); $errors = $this->move_forum($forum_data_sql['forum_id'], $forum_data_sql['parent_id']);
} }
else
{
$forum_data_sql['parent_id'] = $row['parent_id'];
}
}
if (sizeof($errors)) if (sizeof($errors))
{ {