Skip to content

Commit

Permalink
Use Common::mb_* proxies rather than direct mb_* access in case multi…
Browse files Browse the repository at this point in the history
…byte is disabled
  • Loading branch information
mattab committed Dec 15, 2014
1 parent 6f5e4bc commit d97d9a0
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
5 changes: 3 additions & 2 deletions core/Tracker/PageUrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'])) {
Expand Down Expand Up @@ -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));
}
}
Expand Down
2 changes: 1 addition & 1 deletion core/Tracker/Visit.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion plugins/CustomAlerts
2 changes: 1 addition & 1 deletion plugins/QueuedTracking
6 changes: 3 additions & 3 deletions plugins/Referrers/Columns/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -426,4 +426,4 @@ protected function doesLastActionHaveSameReferrer(Visitor $visitor, $referrerTyp
{
return $visitor->getVisitorColumn('referer_type') == $referrerType;
}
}
}
2 changes: 1 addition & 1 deletion tests/PHPUnit/UI
Submodule UI updated from 0165dc to 4cdf80

0 comments on commit d97d9a0

Please sign in to comment.