mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
seems to work just fine now, needs translations
This commit is contained in:
parent
25163d1756
commit
7e7cbc4cc8
|
@ -17,12 +17,12 @@ class AlphaEncrypted implements ValidationRule
|
|||
{
|
||||
try {
|
||||
$decrypted = Crypt::decrypt($value);
|
||||
dump($decrypted);
|
||||
if (!ctype_alpha($decrypted)) {
|
||||
if (!ctype_alpha($decrypted) && !is_null($decrypted)) {
|
||||
$fail($attribute.' is not alphabetic.');
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$fail($e->getMessage());
|
||||
report($e);
|
||||
$fail('something went wrong.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,13 +16,15 @@ class NumericEncrypted implements ValidationRule
|
|||
*/
|
||||
public function validate(string $attribute, mixed $value, Closure $fail): void
|
||||
{
|
||||
|
||||
try {
|
||||
$value = Crypt::decrypt($value);
|
||||
if (!is_numeric($value)) {
|
||||
$decrypted = Crypt::decrypt($value);
|
||||
if (!is_numeric($decrypted) && !is_null($decrypted)) {
|
||||
$fail($attribute.' is not numeric.');
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$fail($e->getMessage());
|
||||
report($e->getMessage());
|
||||
$fail('something went wrong');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue