versao compilada
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-10-15 17:37:00 +02:00
parent 9a96ee8dfe
commit c13f250b87
935 changed files with 210656 additions and 272 deletions
+8 -2
View File
@@ -20,6 +20,14 @@ class OpportunityContacts
$record = Opportunity::withTrashed()->findOrFail($id);
$access->authorize($actor, 'edit', $record);
abort_unless($access->mfa($actor), 403, 'Confirme a autenticação multifator nesta sessão.');
// Validate the persisted form of names/email, rather than padding.
// Non-string input stays with the validator and cannot cause a TypeError.
if (is_string($input['full_name'] ?? null)) {
$input['full_name'] = trim(preg_replace('/\s+/u', ' ', $input['full_name']));
}
if (is_string($input['email'] ?? null)) {
$input['email'] = strtolower(trim($input['email']));
}
$data = Validator::make($input, [
'etag' => 'required|string|size:64',
'full_name' => 'required|string|min:2|max:150',
@@ -28,8 +36,6 @@ class OpportunityContacts
'investor_id' => 'nullable|uuid',
'investor_type' => ['nullable', Rule::in(['domestic', 'foreign', 'institutional', 'individual'])],
])->validate();
$data['email'] = strtolower(trim($data['email']));
$data['full_name'] = trim(preg_replace('/\s+/u', ' ', $data['full_name']));
return DB::transaction(function () use ($actor, $id, $data, $access) {
$record = Opportunity::withTrashed()->whereKey($id)->lockForUpdate()->firstOrFail();