adjust mb_*, str_* function name

This commit is contained in:
Km.Van
2026-07-11 16:54:14 +08:00
parent 923607895e
commit 9867f8ae50
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -438,7 +438,7 @@ final class UtilsCpu
return;
}
$line = $lines[0];
if (0 !== mb_strpos($line, 'cpu ')) {
if (0 !== strpos($line, 'cpu ')) {
return;
}
$items = explode(' ', preg_replace('/\\s+/', ' ', $line));
+2 -2
View File
@@ -7,7 +7,7 @@ final class UtilsLocation
/**
* Get IP location.
*
* @param [string] $ip
* @param string $ip
*
* @return array|null $args
* $args['country'] string Country, e.g, China
@@ -37,7 +37,7 @@ final class UtilsLocation
// get langcode from en-US,en;q=0.9,zh-CN;q=0.8,zh-TW;q=0.7,zh;q=0.6
$langcode = '';
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
if (str_contains($_SERVER['HTTP_ACCEPT_LANGUAGE'], ',')) {
if (false!==strpos($_SERVER['HTTP_ACCEPT_LANGUAGE'], ',')) {
$langcode = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, strpos($_SERVER['HTTP_ACCEPT_LANGUAGE'], ','));
}
}