mirror of
https://github.com/vlucas/valitron.git
synced 2025-12-30 23:01:52 +00:00
Checking if mb_strpos() exists before use them
This commit is contained in:
parent
51575f3f9d
commit
c6b2865ef6
@ -1133,7 +1133,12 @@ class Validator
|
||||
$message = isset($msgs[$rule]) ? $msgs[$rule] : self::ERROR_DEFAULT;
|
||||
|
||||
// Ensure message contains field label
|
||||
if (mb_strpos($message, '{field}') === false) {
|
||||
if (function_exists('mb_strpos')) {
|
||||
$notContains = mb_strpos($message, '{field}') === false;
|
||||
} else {
|
||||
$notContains = strpos($message, '{field}') === false;
|
||||
}
|
||||
if ($notContains) {
|
||||
$message = '{field} ' . $message;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user