diff --git a/phpBB/admin/admin_board.php b/phpBB/admin/admin_board.php
index 099514f680..5cb3ad51f9 100644
--- a/phpBB/admin/admin_board.php
+++ b/phpBB/admin/admin_board.php
@@ -98,10 +98,7 @@ while ($row = $db->sql_fetchrow($result))
if (isset($_POST['submit']))
{
- $sql = "UPDATE " . CONFIG_TABLE . " SET
- config_value = '" . str_replace("\'", "''", $new[$config_name]) . "'
- WHERE config_name = '$config_name'";
- $db->sql_query($sql);
+ set_config($config_name, stripslashes($new[$config_name]));
}
}
@@ -549,9 +546,7 @@ switch ($mode)
{
if (!isset($config[$field]))
{
- $sql = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value)
- VALUES ('$field', '')";
- $db->sql_query($sql);
+ set_config($field, '');
}
}
}
diff --git a/phpBB/admin/admin_forums.php b/phpBB/admin/admin_forums.php
index 9491624db1..66c792d1e4 100644
--- a/phpBB/admin/admin_forums.php
+++ b/phpBB/admin/admin_forums.php
@@ -72,7 +72,7 @@ switch ($mode)
$result = $db->sql_query('SELECT parent_id, left_id, right_id FROM ' . FORUMS_TABLE . " WHERE forum_id = $forum_id");
if (!$row = $db->sql_fetchrow($result))
{
- message_die(ERROR, 'Forum does not exist');
+ trigger_error('Forum does not exist');
}
extract($row);
$forum_info = array($forum_id => $row);
@@ -192,8 +192,8 @@ switch ($mode)
'parent_id' => $parent_id,
'left_id' => $left_id,
'right_id' => $right_id,
- 'forum_status' => (!empty($_POST['is_category'])) ? ITEM_CATEGORY : intval($_POST['forum_status']),
- 'forum_postable' => (!empty($_POST['is_category'])) ? 0 : 1,
+ 'forum_status' => ITEM_UNLOCKED,
+ 'forum_postable' => (!empty($_POST['forum_postable'])) ? 1 : 0,
'forum_name' => sql_quote($_POST['forum_name']),
'forum_desc' => sql_quote($_POST['forum_desc']),
'forum_style' => (!empty($_POST['forum_style'])) ? intval($_POST['forum_style']) : 'NULL',
@@ -210,14 +210,14 @@ switch ($mode)
$forum_id = $db->sql_nextid();
// Redirect to permissions
- redirect('admin_permissions.' . $phpEx . $SID . '&mode=forums&f=' . $forum_id);
+ redirect('admin/admin_permissions.' . $phpEx . $SID . '&mode=forums&f=' . $forum_id);
break;
case 'modify':
if (!$forum_id = intval($_POST['f']))
{
- message_die(ERROR, 'No forum specified');
+ trigger_error('No forum specified');
}
$row = get_forum_info($forum_id);
@@ -271,7 +271,8 @@ switch ($mode)
$db->sql_query('UPDATE ' . FORUMS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql) . " WHERE forum_id = $forum_id");
$message = $user->lang['Forums_updated'] . "
" . sprintf($user->lang['Click_return_forumadmin'], '', '') . '
' . sprintf($user->lang['Click_return_admin_index'], '', '');
- message_die(MESSAGE, $message);
+
+ trigger_error($message);
break;
@@ -300,7 +301,7 @@ switch ($mode)
{
$message = $user->lang['No_destination_forum'] . '
' . sprintf($user->lang['Click_return_forumadmin'], '', '');
- message_die(ERROR, $message);
+ trigger_error($message);
}
move_forum_content($forum_id, $_POST['posts_to_id']);
@@ -325,7 +326,7 @@ switch ($mode)
{
$message = $user->lang['No_destination_forum'] . '
' . sprintf($user->lang['Click_return_forumadmin'], '', '');
- message_die(ERROR, $message);
+ trigger_error($message);
}
$result = $db->sql_query('SELECT forum_id FROM ' . FORUMS_TABLE . " WHERE parent_id = $forum_id");
@@ -360,7 +361,7 @@ switch ($mode)
$return_id = (!empty($_POST['subforums_to_id'])) ? $_POST['subforums_to_id'] : $parent_id;
$message = $user->lang['Forum_deleted'] . '
' . sprintf($user->lang['Click_return_forumadmin'], '', '');
- message_die(MESSAGE, $message);
+ trigger_error($message);
break;
case 'sync':
@@ -745,7 +746,7 @@ while ($row = $db->sql_fetchrow($result))