aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/mcp
diff options
context:
space:
mode:
authormrgoldy <gijsmartens1@gmail.com>2019-01-15 20:58:54 +0100
committermrgoldy <gijsmartens1@gmail.com>2019-01-15 20:58:54 +0100
commita925605b88861eaf21fef0196b21ed46279120a1 (patch)
tree83a9d266315f2862a88e2ad0ff85e6ae82398c63 /phpBB/includes/mcp
parent3f4b7059cb4903a314565ae448d142121e9e9611 (diff)
downloadforums-a925605b88861eaf21fef0196b21ed46279120a1.tar
forums-a925605b88861eaf21fef0196b21ed46279120a1.tar.gz
forums-a925605b88861eaf21fef0196b21ed46279120a1.tar.bz2
forums-a925605b88861eaf21fef0196b21ed46279120a1.tar.xz
forums-a925605b88861eaf21fef0196b21ed46279120a1.zip
[ticket/15942] Optimize count
PHPBB3-15942
Diffstat (limited to 'phpBB/includes/mcp')
-rw-r--r--phpBB/includes/mcp/mcp_main.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php
index 565839b3ee..69d5993a73 100644
--- a/phpBB/includes/mcp/mcp_main.php
+++ b/phpBB/includes/mcp/mcp_main.php
@@ -930,10 +930,11 @@ function mcp_delete_topic($topic_ids, $is_soft = false, $soft_delete_reason = ''
'DELETE_TOPIC_PERMANENTLY_EXPLAIN' => $user->lang('DELETE_TOPIC_PERMANENTLY', count($topic_ids)),
));
- $l_confirm = (count($topic_ids) == 1) ? 'DELETE_TOPIC' : 'DELETE_TOPICS';
+ $count = count($topic_ids);
+ $l_confirm = $count === 1 ? 'DELETE_TOPIC' : 'DELETE_TOPICS';
if ($only_softdeleted)
{
- $l_confirm = array($l_confirm . '_PERMANENTLY', count($topic_ids));
+ $l_confirm = array($l_confirm . '_PERMANENTLY', $count);
$s_hidden_fields['delete_permanent'] = '1';
}
else if ($only_shadow || !$auth->acl_get('m_softdelete', $forum_id))
@@ -1184,10 +1185,11 @@ function mcp_delete_post($post_ids, $is_soft = false, $soft_delete_reason = '',
'DELETE_POST_PERMANENTLY_EXPLAIN' => $user->lang('DELETE_POST_PERMANENTLY', count($post_ids)),
));
- $l_confirm = (count($post_ids) == 1) ? 'DELETE_POST' : 'DELETE_POSTS';
+ $count = count($post_ids);
+ $l_confirm = $count === 1 ? 'DELETE_POST' : 'DELETE_POSTS';
if ($only_softdeleted)
{
- $l_confirm = array($l_confirm . '_PERMANENTLY', (int) count($post_ids));
+ $l_confirm = array($l_confirm . '_PERMANENTLY', $count);
$s_hidden_fields['delete_permanent'] = '1';
}
else if (!$auth->acl_get('m_softdelete', $forum_id))