aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_posting.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2006-05-17 16:58:56 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2006-05-17 16:58:56 +0000
commit760d0a66d4591d8e6fc7660a820742afb1073863 (patch)
tree7b3a7a0231f56df40e87820c65130f21b6584464 /phpBB/includes/functions_posting.php
parent4ea4f1d1da0d1c0586b5348b57c32beb8ab3c181 (diff)
downloadforums-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.php7
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&amp;f=" . $topic_rows[$draft['topic_id']]['forum_id'] . '&amp;t=' . $draft['topic_id'] . '&amp;mode=reply&amp;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&amp;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&amp;i=$id&amp;mode=compose&amp;d=" . $draft['draft_id'];
}