currency Validation changes #vhfw5w

This commit is contained in:
Cüneyt Şentürk 2021-10-04 16:03:00 +03:00
parent 877ff643c8
commit 58d2fe145c

View File

@ -20,7 +20,7 @@ class Validation extends Provider
Validator::extend('currency', function ($attribute, $value, $parameters, $validator) use(&$currency_code) { Validator::extend('currency', function ($attribute, $value, $parameters, $validator) use(&$currency_code) {
$status = false; $status = false;
if (!is_string($value) || (strlen($value) != 3)) { if (!is_string($value)) {
return $status; return $status;
} }
@ -30,6 +30,10 @@ class Validation extends Provider
$status = true; $status = true;
} }
if (strlen($value) != 3) {
return $status;
}
$currency_code = $value; $currency_code = $value;
return $status; return $status;