Skip to content

Commit

Permalink
getTopicInfo didn't return the necessary informations to delete a mes…
Browse files Browse the repository at this point in the history
…sage - thanks scripple for reporting and debugging

Signed-off-by: emanuele <emanuele45@gmail.com>
  • Loading branch information
emanuele45 committed Mar 17, 2014
1 parent ab548a8 commit 28cf168
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sources/controllers/RemoveTopic.controller.php
Expand Up @@ -103,6 +103,7 @@ public function action_deletemsg()

// This has some handy functions for topics
require_once(SUBSDIR . '/Topic.subs.php');
require_once(SUBSDIR . '/Messages.subs.php');

$_REQUEST['msg'] = (int) $_REQUEST['msg'];

Expand All @@ -112,10 +113,10 @@ public function action_deletemsg()

$this->removeDeleteConcurrence();

$topic_info = getTopicInfo($topic, 'message');
$topic_info = loadMessageDetails(array('t.id_member_started'), array('LEFT JOIN {db_prefix}topics AS t ON (m.id_topic = t.id_topic)'), array('message_list' => $_REQUEST['msg']));

// Verify they can see this!
if ($modSettings['postmod_active'] && !$topic_info['msg_approved'] && !empty($topic_info['id_member']) && $topic_info['id_member'] != $user_info['id'])
if ($modSettings['postmod_active'] && !$topic_info['approved'] && !empty($topic_info['id_member']) && $topic_info['id_member'] != $user_info['id'])
isAllowedTo('approve_posts');

if ($topic_info['id_member'] == $user_info['id'])
Expand Down

0 comments on commit 28cf168

Please sign in to comment.