|
|
|
@ -48,7 +48,7 @@ class BaseStringHelper
|
|
|
|
|
if ($length === null) { |
|
|
|
|
$length = static::byteLength($string); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return mb_substr($string, $start, $length, '8bit'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -71,7 +71,7 @@ class BaseStringHelper
|
|
|
|
|
if ($len > 0 && mb_substr($path, -$len) === $suffix) { |
|
|
|
|
$path = mb_substr($path, 0, -$len); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$path = rtrim(str_replace('\\', '/', $path), '/'); |
|
|
|
|
$pos = mb_strrpos($path, '/'); |
|
|
|
|
if ($pos !== false) { |
|
|
|
@ -468,7 +468,7 @@ class BaseStringHelper
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$parts = preg_split('/(\s+[^\w]+\s+|^[^\w]+\s+|\s+)/u', $string, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE); |
|
|
|
|
$ucfirstEven = !trim(mb_substr($parts[0], -1, 1, $encoding)); |
|
|
|
|
$ucfirstEven = trim(mb_substr($parts[0], -1, 1, $encoding)) === ''; |
|
|
|
|
foreach ($parts as $key => $value) { |
|
|
|
|
$isEven = (bool)($key % 2); |
|
|
|
|
if ($ucfirstEven === $isEven) { |
|
|
|
|