mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 17:21:39 +09:00
Fix special case for contains() when the needle is empty
This commit is contained in:
parent
928a24fac0
commit
cd427e04ec
1 changed files with 2 additions and 2 deletions
|
|
@ -334,11 +334,11 @@ function contains($needle, $haystack, $case_sensitive = true)
|
|||
}
|
||||
elseif ($case_sensitive)
|
||||
{
|
||||
return (strpos($haystack, $needle) !== false);
|
||||
return $needle === '' || strpos($haystack, $needle) !== false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return (stripos($haystack, $needle) !== false);
|
||||
return $needle === '' || stripos($haystack, $needle) !== false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue