mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-03-17 20:54:52 +08:00
fix mb_strpos empty delimiter
This commit is contained in:
parent
50f06e6a4f
commit
3cfcbaec16
@ -96,10 +96,10 @@ function unicode_decode(string $str): ?string
|
||||
*/
|
||||
function match_pattern(string $pattern, string $subject): bool
|
||||
{
|
||||
if (mb_strpos($pattern, '') === 0 && mb_strpos($subject, '') === 0) {
|
||||
if (empty($pattern) && empty($subject)) {
|
||||
return true;
|
||||
}
|
||||
if (mb_strpos($pattern, '*') === 0 && mb_substr($pattern, 1, 1) !== '' && mb_strpos($subject, '') === 0) {
|
||||
if (mb_strpos($pattern, '*') === 0 && mb_substr($pattern, 1, 1) !== '' && empty($subject)) {
|
||||
return false;
|
||||
}
|
||||
if (mb_strpos($pattern, mb_substr($subject, 0, 1)) === 0) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user