mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
fix bug #1857
git-svn-id: file:///svn/phpbb/trunk@5922 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
4ea4f1d1da
commit
760d0a66d4
2 changed files with 15 additions and 16 deletions
|
@ -685,11 +685,11 @@ function load_drafts($topic_id = 0, $forum_id = 0, $id = 0)
|
||||||
$topic_ids = $draft_rows = array();
|
$topic_ids = $draft_rows = array();
|
||||||
|
|
||||||
// Load those drafts not connected to forums/topics
|
// Load those drafts not connected to forums/topics
|
||||||
|
// If forum_id == 0 AND topic_id == 0 then this is a PM draft
|
||||||
$sql = 'SELECT *
|
$sql = 'SELECT *
|
||||||
FROM ' . DRAFTS_TABLE . '
|
FROM ' . DRAFTS_TABLE . '
|
||||||
WHERE user_id = ' . $user->data['user_id'] . '
|
WHERE user_id = ' . $user->data['user_id'] . '
|
||||||
AND forum_id = 0
|
AND (forum_id = 0 OR topic_id = 0)
|
||||||
OR topic_id = 0
|
|
||||||
ORDER BY save_time DESC';
|
ORDER BY save_time DESC';
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
|
@ -762,7 +762,7 @@ function load_drafts($topic_id = 0, $forum_id = 0, $id = 0)
|
||||||
|
|
||||||
$insert_url = "{$phpbb_root_path}posting.$phpEx$SID&f=" . $topic_rows[$draft['topic_id']]['forum_id'] . '&t=' . $draft['topic_id'] . '&mode=reply&d=' . $draft['draft_id'];
|
$insert_url = "{$phpbb_root_path}posting.$phpEx$SID&f=" . $topic_rows[$draft['topic_id']]['forum_id'] . '&t=' . $draft['topic_id'] . '&mode=reply&d=' . $draft['draft_id'];
|
||||||
}
|
}
|
||||||
else if ($auth->acl_get('f_read', $draft['forum_id']))
|
else if ($draft['forum_id'] && $auth->acl_get('f_read', $draft['forum_id']))
|
||||||
{
|
{
|
||||||
$link_forum = true;
|
$link_forum = true;
|
||||||
$view_url = "{$phpbb_root_path}viewforum.$phpEx$SID&f=" . $draft['forum_id'];
|
$view_url = "{$phpbb_root_path}viewforum.$phpEx$SID&f=" . $draft['forum_id'];
|
||||||
|
@ -772,6 +772,7 @@ function load_drafts($topic_id = 0, $forum_id = 0, $id = 0)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// Either display as PM draft if forum_id and topic_id are empty or if access to the forums has been denied afterwards...
|
||||||
$link_pm = true;
|
$link_pm = true;
|
||||||
$insert_url = "{$phpbb_root_path}ucp.$phpEx$SID&i=$id&mode=compose&d=" . $draft['draft_id'];
|
$insert_url = "{$phpbb_root_path}ucp.$phpEx$SID&i=$id&mode=compose&d=" . $draft['draft_id'];
|
||||||
}
|
}
|
||||||
|
|
|
@ -301,7 +301,7 @@ if (isset($post_data['post_text']))
|
||||||
$message_parser->get_submitted_attachment_data();
|
$message_parser->get_submitted_attachment_data();
|
||||||
|
|
||||||
// Set some default variables
|
// Set some default variables
|
||||||
$uninit = array('post_attachment' => 0, 'poster_id' => $user->data['user_id'], 'enable_magic_url' => 0, 'topic_status' => 0, 'topic_type' => POST_NORMAL, 'subject' => '', 'topic_title' => '', 'post_time' => 0, 'post_edit_reason' => '', 'notify_set' => 0);
|
$uninit = array('post_attachment' => 0, 'poster_id' => $user->data['user_id'], 'enable_magic_url' => 0, 'topic_status' => 0, 'topic_type' => POST_NORMAL, 'post_subject' => '', 'topic_title' => '', 'post_time' => 0, 'post_edit_reason' => '', 'notify_set' => 0);
|
||||||
foreach ($uninit as $var_name => $default_value)
|
foreach ($uninit as $var_name => $default_value)
|
||||||
{
|
{
|
||||||
if (!isset($post_data[$var_name]))
|
if (!isset($post_data[$var_name]))
|
||||||
|
@ -434,9 +434,9 @@ if ($draft_id && $user->data['is_registered'] && $auth->acl_get('u_savedrafts'))
|
||||||
|
|
||||||
if ($row)
|
if ($row)
|
||||||
{
|
{
|
||||||
$_REQUEST['subject'] = html_entity_decode($row['draft_subject']);
|
$post_data['post_subject'] = $row['draft_subject'];
|
||||||
$_REQUEST['message'] = html_entity_decode($row['draft_message']);
|
$message_parser->message = $row['draft_message'];
|
||||||
$refresh = true;
|
|
||||||
$template->assign_var('S_DRAFT_LOADED', true);
|
$template->assign_var('S_DRAFT_LOADED', true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -454,12 +454,12 @@ if ($load && $post_data['drafts'])
|
||||||
if ($submit || $preview || $refresh)
|
if ($submit || $preview || $refresh)
|
||||||
{
|
{
|
||||||
$post_data['topic_cur_post_id'] = request_var('topic_cur_post_id', 0);
|
$post_data['topic_cur_post_id'] = request_var('topic_cur_post_id', 0);
|
||||||
$post_data['subject'] = request_var('subject', '', true);
|
$post_data['post_subject'] = request_var('subject', '', true);
|
||||||
|
|
||||||
// If subject is all-uppercase then we make all lowercase (we do not want to be yelled at too :P)
|
// If subject is all-uppercase then we make all lowercase (we do not want to be yelled at too :P)
|
||||||
if ($post_data['subject'] && strcmp($post_data['subject'], strtoupper($post_data['subject'])) == 0)
|
if ($post_data['post_subject'] && strcmp($post_data['post_subject'], strtoupper($post_data['post_subject'])) == 0)
|
||||||
{
|
{
|
||||||
$post_data['subject'] = strtolower($post_data['subject']);
|
$post_data['post_subject'] = strtolower($post_data['post_subject']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$message_parser->message = request_var('message', '', true);
|
$message_parser->message = request_var('message', '', true);
|
||||||
|
@ -635,7 +635,7 @@ if ($submit || $preview || $refresh)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse subject
|
// Parse subject
|
||||||
if (!$post_data['subject'] && ($mode == 'post' || ($mode == 'edit' && $post_data['topic_first_post_id'] == $post_id)))
|
if (!$post_data['post_subject'] && ($mode == 'post' || ($mode == 'edit' && $post_data['topic_first_post_id'] == $post_id)))
|
||||||
{
|
{
|
||||||
$error[] = $user->lang['EMPTY_SUBJECT'];
|
$error[] = $user->lang['EMPTY_SUBJECT'];
|
||||||
}
|
}
|
||||||
|
@ -780,7 +780,7 @@ if ($submit || $preview || $refresh)
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = array(
|
$data = array(
|
||||||
'topic_title' => (empty($post_data['topic_title'])) ? $post_data['subject'] : $post_data['topic_title'],
|
'topic_title' => (empty($post_data['topic_title'])) ? $post_data['post_subject'] : $post_data['topic_title'],
|
||||||
'topic_first_post_id' => (isset($post_data['topic_first_post_id'])) ? (int) $post_data['topic_first_post_id'] : 0,
|
'topic_first_post_id' => (isset($post_data['topic_first_post_id'])) ? (int) $post_data['topic_first_post_id'] : 0,
|
||||||
'topic_last_post_id' => (isset($post_data['topic_last_post_id'])) ? (int) $post_data['topic_last_post_id'] : 0,
|
'topic_last_post_id' => (isset($post_data['topic_last_post_id'])) ? (int) $post_data['topic_last_post_id'] : 0,
|
||||||
'topic_time_limit' => (int) $post_data['topic_time_limit'],
|
'topic_time_limit' => (int) $post_data['topic_time_limit'],
|
||||||
|
@ -813,7 +813,7 @@ if ($submit || $preview || $refresh)
|
||||||
);
|
);
|
||||||
unset($message_parser);
|
unset($message_parser);
|
||||||
|
|
||||||
$redirect_url = submit_post($mode, $post_data['subject'], $post_data['username'], $post_data['topic_type'], $poll, $data, $update_message);
|
$redirect_url = submit_post($mode, $post_data['post_subject'], $post_data['username'], $post_data['topic_type'], $poll, $data, $update_message);
|
||||||
|
|
||||||
meta_refresh(3, $redirect_url);
|
meta_refresh(3, $redirect_url);
|
||||||
|
|
||||||
|
@ -823,8 +823,6 @@ if ($submit || $preview || $refresh)
|
||||||
trigger_error($message);
|
trigger_error($message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$post_data['post_subject'] = $post_data['subject'];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Preview
|
// Preview
|
||||||
|
@ -855,7 +853,7 @@ if (!sizeof($error) && $preview)
|
||||||
$preview_signature = '';
|
$preview_signature = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$preview_subject = censor_text($post_data['subject']);
|
$preview_subject = censor_text($post_data['post_subject']);
|
||||||
|
|
||||||
// Poll Preview
|
// Poll Preview
|
||||||
if (($mode == 'post' || ($mode == 'edit' && $post_id == $post_data['topic_first_post_id'] && (!$post_data['poll_last_vote'] || $auth->acl_get('m_edit', $forum_id))))
|
if (($mode == 'post' || ($mode == 'edit' && $post_id == $post_data['topic_first_post_id'] && (!$post_data['poll_last_vote'] || $auth->acl_get('m_edit', $forum_id))))
|
||||||
|
|
Loading…
Add table
Reference in a new issue