aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/mcp/mcp_main.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2012-12-18 14:50:00 +0100
committerJoas Schilling <nickvergessen@gmx.de>2012-12-18 14:50:00 +0100
commit293b070efba81dd03d633fc9641c83c63c468bb8 (patch)
tree9d79b06e87c1fd7fcbfae052ff7d2d99d1350f34 /phpBB/includes/mcp/mcp_main.php
parentb917e5a4bb66a1928ea72fa2b9419807a0793816 (diff)
downloadforums-293b070efba81dd03d633fc9641c83c63c468bb8.tar
forums-293b070efba81dd03d633fc9641c83c63c468bb8.tar.gz
forums-293b070efba81dd03d633fc9641c83c63c468bb8.tar.bz2
forums-293b070efba81dd03d633fc9641c83c63c468bb8.tar.xz
forums-293b070efba81dd03d633fc9641c83c63c468bb8.zip
[feature/soft-delete] Fix a problem with the "only softdeleted posts" logic
PHPBB3-9657
Diffstat (limited to 'phpBB/includes/mcp/mcp_main.php')
-rw-r--r--phpBB/includes/mcp/mcp_main.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php
index d8ef3e261b..d29ecfe003 100644
--- a/phpBB/includes/mcp/mcp_main.php
+++ b/phpBB/includes/mcp/mcp_main.php
@@ -786,15 +786,15 @@ function mcp_delete_topic($topic_ids, $is_soft = false, $soft_delete_reason = ''
$user->add_lang('posting');
$only_softdeleted = false;
- // If there are only soft deleted topics, we display a message why the option is not available
if ($auth->acl_get('m_delete', $forum_id) && $auth->acl_get('m_softdelete', $forum_id))
{
+ // If there are only soft deleted topics, we display a message why the option is not available
$sql = 'SELECT topic_id
FROM ' . TOPICS_TABLE . '
WHERE ' . $db->sql_in_set('topic_id', $topic_ids) . '
AND topic_visibility <> ' . ITEM_DELETED;
$result = $db->sql_query_limit($sql, 1);
- $only_softdeleted = (bool) $db->sql_fetchfield('topic_id');
+ $only_softdeleted = !$db->sql_fetchfield('topic_id');
$db->sql_freeresult($result);
}
@@ -806,7 +806,7 @@ function mcp_delete_topic($topic_ids, $is_soft = false, $soft_delete_reason = ''
'S_DELETE_REASON' => $auth->acl_get('m_softdelete', $forum_id),
));
- $l_confirm = (sizeof($post_ids) == 1) ? 'DELETE_TOPIC' : 'DELETE_TOPICS';
+ $l_confirm = (sizeof($topic_ids) == 1) ? 'DELETE_TOPIC' : 'DELETE_TOPICS';
if ($only_softdeleted)
{
$l_confirm .= '_PERMANENTLY';
@@ -1023,15 +1023,15 @@ function mcp_delete_post($post_ids, $is_soft = false, $soft_delete_reason = '')
$user->add_lang('posting');
$only_softdeleted = false;
- // If there are only soft deleted posts, we display a message why the option is not available
if ($auth->acl_get('m_delete', $forum_id) && $auth->acl_get('m_softdelete', $forum_id))
{
+ // If there are only soft deleted posts, we display a message why the option is not available
$sql = 'SELECT post_id
FROM ' . POSTS_TABLE . '
WHERE ' . $db->sql_in_set('post_id', $post_ids) . '
AND post_visibility <> ' . ITEM_DELETED;
$result = $db->sql_query_limit($sql, 1);
- $only_softdeleted = (bool) $db->sql_fetchfield('post_id');
+ $only_softdeleted = !$db->sql_fetchfield('post_id');
$db->sql_freeresult($result);
}