Support for Rich Text Input (#630)
* Support for Rich Text Input * rich text support for prefilled * apply Purify for rich_text --------- Co-authored-by: Julien Nahum <julien@nahum.net>
This commit is contained in:
@@ -14,6 +14,7 @@ use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Validation\Rule;
|
||||
use Stevebauman\Purify\Facades\Purify;
|
||||
|
||||
class AnswerFormRequest extends FormRequest
|
||||
{
|
||||
@@ -175,6 +176,7 @@ class AnswerFormRequest extends FormRequest
|
||||
{
|
||||
switch ($property['type']) {
|
||||
case 'text':
|
||||
case 'rich_text':
|
||||
case 'signature':
|
||||
return ['string'];
|
||||
case 'number':
|
||||
@@ -282,6 +284,10 @@ class AnswerFormRequest extends FormRequest
|
||||
if ($property['type'] === 'phone_number' && (!isset($property['use_simple_text_input']) || !$property['use_simple_text_input']) && $receivedValue && in_array($receivedValue, $countryCodeMapper)) {
|
||||
$mergeData[$property['id']] = null;
|
||||
}
|
||||
|
||||
if ($property['type'] === 'rich_text' && $receivedValue) {
|
||||
$mergeData[$property['id']] = Purify::clean($receivedValue);
|
||||
}
|
||||
});
|
||||
|
||||
$this->merge($mergeData);
|
||||
|
||||
Reference in New Issue
Block a user