mirror of
https://github.com/snipe/snipe-it.git
synced 2026-08-18 11:15:42 +00:00
encrypted boolean bug, parent::prepareForValidation() added
This commit is contained in:
@ -25,6 +25,8 @@ class UpdateAssetRequest extends ImageUploadRequest
|
||||
|
||||
public function prepareForValidation(): void
|
||||
{
|
||||
parent::prepareForValidation();
|
||||
|
||||
if ($this->filled('purchase_cost') && ! is_float($this->input('purchase_cost')) && preg_match('/^[\d.,]+$/', (string) $this->input('purchase_cost'))) {
|
||||
$this->merge(['purchase_cost' => Helper::ParseCurrency($this->input('purchase_cost'))]);
|
||||
}
|
||||
|
||||
@ -22,7 +22,7 @@ class BooleanEncrypted implements ValidationRule
|
||||
$attributeName = trim(preg_replace('/_+|snipeit|\d+/', ' ', $attribute));
|
||||
$decrypted = Crypt::decrypt($value);
|
||||
|
||||
if (!$this->validateBoolean($attributeName, $decrypted) && !is_null($decrypted)) {
|
||||
if (!$this->validateBoolean($attributeName, $decrypted, []) && !is_null($decrypted)) {
|
||||
$fail(trans('validation.ipv6', ['attribute' => $attributeName]));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
|
||||
Reference in New Issue
Block a user