Skip to content

Commit

Permalink
Multibyte String Enhancements: Update strtolower() and strtoupper()
Browse files Browse the repository at this point in the history
  • Loading branch information
raamdev committed Mar 4, 2016
1 parent e013ea8 commit de3bd92
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/includes/traits/Shared/DomainMappingUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,6 @@ public function domainMappingBlogDomains($blog_id = 0)
}
$wpdb->suppress_errors($suppressing_errors); // Restore.

return $domains = array_unique(array_map('strtolower', (array) $domains));
return $domains = array_unique(array_map('mb_strtolower', (array) $domains));
}
}
2 changes: 1 addition & 1 deletion src/includes/traits/Shared/FsUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function nDirSeps($dir_file, $allow_trailing_slash = false)
}
if (mb_strpos($dir_file, ':' !== false)) {
if (preg_match('/^(?P<drive_letter>[a-zA-Z])\:[\/\\\\]/u', $dir_file)) {
$dir_file = preg_replace_callback('/^(?P<drive_letter>[a-zA-Z])\:[\/\\\\]/u', create_function('$m', 'return strtoupper($m[0]);'), $dir_file);
$dir_file = preg_replace_callback('/^(?P<drive_letter>[a-zA-Z])\:[\/\\\\]/u', create_function('$m', 'return mb_strtoupper($m[0]);'), $dir_file);
}
}
$dir_file = preg_replace('/\/+/u', '/', str_replace([DIRECTORY_SEPARATOR, '\\', '/'], '/', $dir_file));
Expand Down
2 changes: 1 addition & 1 deletion src/includes/traits/Shared/HttpUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function cacheableHeadersList()
'X-Powered-By',
'X-UA-Compatible',
];
$cacheable_headers = array_map('strtolower', $cacheable_headers);
$cacheable_headers = array_map('mb_strtolower', $cacheable_headers);

foreach ($headers as $_key => $_header) {
$_header = mb_strtolower((string) strstr($_header, ':', true));
Expand Down

0 comments on commit de3bd92

Please sign in to comment.