From 4418a36ccf4db9442576f663d4ee70f3b4be150e Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sun, 8 Jul 2018 21:58:07 -0400 Subject: [PATCH] Update admin_functions and common from HESK 2.8.2 --- inc/admin_functions.inc.php | 4 ++-- inc/common.inc.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/inc/admin_functions.inc.php b/inc/admin_functions.inc.php index 5e74994c..5c9829d6 100644 --- a/inc/admin_functions.inc.php +++ b/inc/admin_functions.inc.php @@ -222,10 +222,10 @@ function hesk_mergeTickets($merge_these, $merge_into) $total = 0; $staffreplies = 0; - $res = hesk_dbQuery("SELECT COUNT(*) as `cnt`, `staffid` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "replies` WHERE `replyto`=" . intval($ticket['id']) . " GROUP BY CASE WHEN `staffid` = 0 THEN 0 ELSE 1 END ASC"); + $res = hesk_dbQuery("SELECT COUNT(*) as `cnt`, (CASE WHEN `staffid` = 0 THEN 0 ELSE 1 END) AS `staffcnt` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "replies` WHERE `replyto`=" . intval($ticket['id']) . " GROUP BY CASE WHEN `staffid` = 0 THEN 0 ELSE 1 END ASC"); while ($row = hesk_dbFetchAssoc($res)) { $total += $row['cnt']; - $staffreplies += ($row['staffid'] ? $row['cnt'] : 0); + $staffreplies += ($row['staffcnt'] ? $row['cnt'] : 0); } $replies_sql = " `replies`={$total}, `staffreplies`={$staffreplies} , "; diff --git a/inc/common.inc.php b/inc/common.inc.php index 0dba9eee..e862aa99 100644 --- a/inc/common.inc.php +++ b/inc/common.inc.php @@ -390,7 +390,7 @@ function hesk_mb_strlen($in) } // END hesk_mb_strlen() function hesk_mb_strtolower($in) { - return function_exists('mb_strtolower') ? mb_strtolower($in) : strtolower($in); + return function_exists('mb_strtolower') ? mb_strtolower($in, 'UTF-8') : strtolower($in); } // END hesk_mb_strtolower() function hesk_ucfirst($in) {