mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-04 02:22:39 +00:00
Merge branch 'master' into 2.6
This commit is contained in:
commit
3a70d9c033
12 changed files with 138 additions and 29 deletions
|
@ -814,14 +814,13 @@ class Validation {
|
|||
* @return bool Success.
|
||||
*/
|
||||
public static function inList($check, $list, $caseInsensitive = false) {
|
||||
$strict = !is_numeric($check);
|
||||
|
||||
if ($caseInsensitive) {
|
||||
$list = array_map('mb_strtolower', $list);
|
||||
$check = mb_strtolower($check);
|
||||
} else {
|
||||
$list = array_map('strval', $list);
|
||||
}
|
||||
|
||||
return in_array((string)$check, $list, $strict);
|
||||
return in_array((string)$check, $list, true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue