Skip to content

A free open source IT asset/license management system

encrypted boolean bug, parent::prepareForValidation() added

spencerrlongg9ce2c06f06b1
diff --git a/app/Http/Requests/UpdateAssetRequest.php b/app/Http/Requests/UpdateAssetRequest.php
index d1ba3ee4fb..74a9a92559 100644
--- a/app/Http/Requests/UpdateAssetRequest.php
+++ b/app/Http/Requests/UpdateAssetRequest.php
@@ -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'))]);
}
diff --git a/app/Rules/BooleanEncrypted.php b/app/Rules/BooleanEncrypted.php
index 06fd370703..0e2671ed84 100644
--- a/app/Rules/BooleanEncrypted.php
+++ b/app/Rules/BooleanEncrypted.php
@@ -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) {