diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2006-05-17 16:58:56 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-05-17 16:58:56 +0000 |
commit | 760d0a66d4591d8e6fc7660a820742afb1073863 (patch) | |
tree | 7b3a7a0231f56df40e87820c65130f21b6584464 /phpBB/includes/functions_posting.php | |
parent | 4ea4f1d1da0d1c0586b5348b57c32beb8ab3c181 (diff) | |
download | forums-760d0a66d4591d8e6fc7660a820742afb1073863.tar forums-760d0a66d4591d8e6fc7660a820742afb1073863.tar.gz forums-760d0a66d4591d8e6fc7660a820742afb1073863.tar.bz2 forums-760d0a66d4591d8e6fc7660a820742afb1073863.tar.xz forums-760d0a66d4591d8e6fc7660a820742afb1073863.zip |
fix bug #1857
git-svn-id: file:///svn/phpbb/trunk@5922 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_posting.php')
-rw-r--r-- | phpBB/includes/functions_posting.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 558620c3cf..5782463f60 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -685,11 +685,11 @@ function load_drafts($topic_id = 0, $forum_id = 0, $id = 0) $topic_ids = $draft_rows = array(); // Load those drafts not connected to forums/topics + // If forum_id == 0 AND topic_id == 0 then this is a PM draft $sql = 'SELECT * FROM ' . DRAFTS_TABLE . ' WHERE user_id = ' . $user->data['user_id'] . ' - AND forum_id = 0 - OR topic_id = 0 + AND (forum_id = 0 OR topic_id = 0) ORDER BY save_time DESC'; $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']; } - 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; $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 { + // 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; $insert_url = "{$phpbb_root_path}ucp.$phpEx$SID&i=$id&mode=compose&d=" . $draft['draft_id']; } |