Skip to content

Commit 965c5f2

Browse files
apply Purify for rich_text
1 parent 0019ed2 commit 965c5f2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

api/app/Http/Requests/AnswerFormRequest.php

+5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Illuminate\Http\Request;
1515
use Illuminate\Support\Str;
1616
use Illuminate\Validation\Rule;
17+
use Stevebauman\Purify\Facades\Purify;
1718

1819
class AnswerFormRequest extends FormRequest
1920
{
@@ -275,6 +276,10 @@ protected function prepareForValidation()
275276
if ($property['type'] === 'phone_number' && (!isset($property['use_simple_text_input']) || !$property['use_simple_text_input']) && $receivedValue && in_array($receivedValue, $countryCodeMapper)) {
276277
$mergeData[$property['id']] = null;
277278
}
279+
280+
if ($property['type'] === 'rich_text' && $receivedValue) {
281+
$mergeData[$property['id']] = Purify::clean($receivedValue);
282+
}
278283
});
279284

280285
$this->merge($mergeData);

0 commit comments

Comments
 (0)