aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/ucp/ucp_pm_compose.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2007-07-12 16:14:07 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2007-07-12 16:14:07 +0000
commit002dd8155708415b3c1c828789feccbfc087a387 (patch)
tree9c7ec297cc23082f2b5894cd28657f5e7b2492fb /phpBB/includes/ucp/ucp_pm_compose.php
parent2ba03a411e561cb943f8ec8f11afc51eaa720275 (diff)
downloadforums-002dd8155708415b3c1c828789feccbfc087a387.tar
forums-002dd8155708415b3c1c828789feccbfc087a387.tar.gz
forums-002dd8155708415b3c1c828789feccbfc087a387.tar.bz2
forums-002dd8155708415b3c1c828789feccbfc087a387.tar.xz
forums-002dd8155708415b3c1c828789feccbfc087a387.zip
some more fixes
git-svn-id: file:///svn/phpbb/trunk@7875 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/ucp/ucp_pm_compose.php')
-rw-r--r--phpBB/includes/ucp/ucp_pm_compose.php20
1 files changed, 19 insertions, 1 deletions
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php
index e296ad12b1..56a11afe33 100644
--- a/phpBB/includes/ucp/ucp_pm_compose.php
+++ b/phpBB/includes/ucp/ucp_pm_compose.php
@@ -208,12 +208,30 @@ function compose_pm($id, $mode, $action)
if ($sql)
{
- $result = $db->sql_query_limit($sql, 1);
+ $result = $db->sql_query($sql);
$post = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if (!$post)
{
+ // If editing it could be the recipient already read the message...
+ if ($action == 'edit')
+ {
+ $sql = 'SELECT p.*, t.folder_id
+ FROM ' . PRIVMSGS_TO_TABLE . ' t, ' . PRIVMSGS_TABLE . ' p
+ WHERE t.user_id = ' . $user->data['user_id'] . "
+ AND t.msg_id = $msg_id
+ AND t.msg_id = p.msg_id";
+ $result = $db->sql_query($sql);
+ $post = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ if ($post)
+ {
+ trigger_error('NO_EDIT_READ_MESSAGE');
+ }
+ }
+
trigger_error('NO_MESSAGE');
}