From d97d9a0a3711752271184a032250200b0f783c5a Mon Sep 17 00:00:00 2001 From: mattab Date: Mon, 15 Dec 2014 16:25:42 +1300 Subject: [PATCH] Use Common::mb_* proxies rather than direct mb_* access in case multibyte is disabled --- core/Tracker/PageUrl.php | 5 +++-- core/Tracker/Visit.php | 2 +- plugins/CustomAlerts | 2 +- plugins/QueuedTracking | 2 +- plugins/Referrers/Columns/Base.php | 6 +++--- tests/PHPUnit/UI | 2 +- 6 files changed, 10 insertions(+), 9 deletions(-) diff --git a/core/Tracker/PageUrl.php b/core/Tracker/PageUrl.php index 4174a3168fd..be1c31cf00a 100644 --- a/core/Tracker/PageUrl.php +++ b/core/Tracker/PageUrl.php @@ -157,7 +157,7 @@ protected static function cleanupHostAndHashTag($parsedUrl, $idSite = false) } if (!empty($parsedUrl['host'])) { - $parsedUrl['host'] = mb_strtolower($parsedUrl['host'], 'UTF-8'); + $parsedUrl['host'] = Common::mb_strtolower($parsedUrl['host'], 'UTF-8'); } if (!empty($parsedUrl['fragment'])) { @@ -219,7 +219,8 @@ protected static function reencodeParameterValue($value, $encoding) { if (is_string($value)) { $decoded = urldecode($value); - if (@mb_check_encoding($decoded, $encoding)) { + if (function_exists('mb_check_encoding') + && @mb_check_encoding($decoded, $encoding)) { $value = urlencode(mb_convert_encoding($decoded, 'UTF-8', $encoding)); } } diff --git a/core/Tracker/Visit.php b/core/Tracker/Visit.php index 4e108450b5d..41db09e557f 100644 --- a/core/Tracker/Visit.php +++ b/core/Tracker/Visit.php @@ -422,7 +422,7 @@ public static function isHostKnownAliasHost($urlHost, $idSite) private static function toCanonicalHost($host) { - $hostLower = mb_strtolower($host, 'UTF-8'); + $hostLower = Common::mb_strtolower($host, 'UTF-8'); return str_replace('www.', '', $hostLower); } diff --git a/plugins/CustomAlerts b/plugins/CustomAlerts index 2f10c8b4962..e886aa43f4c 160000 --- a/plugins/CustomAlerts +++ b/plugins/CustomAlerts @@ -1 +1 @@ -Subproject commit 2f10c8b496252d1527a47864cf39d18b359b7ae3 +Subproject commit e886aa43f4c248bf6aaeeef05885f4acdf190a82 diff --git a/plugins/QueuedTracking b/plugins/QueuedTracking index b64788b4b7a..f73280a6499 160000 --- a/plugins/QueuedTracking +++ b/plugins/QueuedTracking @@ -1 +1 @@ -Subproject commit b64788b4b7a6286d8c3bc612fabc8e38c9391c2d +Subproject commit f73280a649974a2b0882f1606f732057cee50dc5 diff --git a/plugins/Referrers/Columns/Base.php b/plugins/Referrers/Columns/Base.php index 5e8c186af88..feacc90e55b 100644 --- a/plugins/Referrers/Columns/Base.php +++ b/plugins/Referrers/Columns/Base.php @@ -236,8 +236,8 @@ protected function detectReferrerDirectEntry() if (!empty($this->referrerHost)) { // is the referrer host the current host? if (isset($this->currentUrlParse['host'])) { - $currentHost = mb_strtolower($this->currentUrlParse['host'], 'UTF-8'); - if ($currentHost == mb_strtolower($this->referrerHost, 'UTF-8')) { + $currentHost = Common::mb_strtolower($this->currentUrlParse['host'], 'UTF-8'); + if ($currentHost == Common::mb_strtolower($this->referrerHost, 'UTF-8')) { $this->typeReferrerAnalyzed = Common::REFERRER_TYPE_DIRECT_ENTRY; return true; } @@ -426,4 +426,4 @@ protected function doesLastActionHaveSameReferrer(Visitor $visitor, $referrerTyp { return $visitor->getVisitorColumn('referer_type') == $referrerType; } -} \ No newline at end of file +} diff --git a/tests/PHPUnit/UI b/tests/PHPUnit/UI index 0165dcc57e6..4cdf80fc990 160000 --- a/tests/PHPUnit/UI +++ b/tests/PHPUnit/UI @@ -1 +1 @@ -Subproject commit 0165dcc57e66d0dfdeb2ff6bb2905e125fde722c +Subproject commit 4cdf80fc99025b71e5d8e59419d2af749e466df6