mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
[3.x] fix(forms): escape placeholder attributes so quotes render correctly
Escape placeholder values when rendering placeholder attributes so double quotes do not break the attribute or render as backslashes. Apply HTML escaping at output time while preserving nulls. Components: text-input, textarea, color-picker, date-time-picker (native). Refs #17170.
This commit is contained in:
@@ -71,7 +71,7 @@
|
||||
'id' => $getId(),
|
||||
'inlinePrefix' => $isPrefixInline && (count($prefixActions) || $prefixIcon || filled($prefixLabel)),
|
||||
'inlineSuffix' => $isSuffixInline && (count($suffixActions) || $suffixIcon || filled($suffixLabel)),
|
||||
'placeholder' => $getPlaceholder(),
|
||||
'placeholder' => ($getPlaceholder() === null) ? null : e((string) $getPlaceholder()),
|
||||
'required' => $isRequired() && (! $isConcealed()),
|
||||
'type' => 'text',
|
||||
'x-model' . ($isLiveDebounced ? '.debounce.' . $liveDebounce : null) => 'state',
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
'list' => $datalistOptions ? $id . '-list' : null,
|
||||
'max' => $hasTime ? $maxDate : ($maxDate ? \Carbon\Carbon::parse($maxDate)->toDateString() : null),
|
||||
'min' => $hasTime ? $minDate : ($minDate ? \Carbon\Carbon::parse($minDate)->toDateString() : null),
|
||||
'placeholder' => $getPlaceholder(),
|
||||
'placeholder' => ($getPlaceholder() === null) ? null : e((string) $getPlaceholder()),
|
||||
'readonly' => $isReadOnly(),
|
||||
'required' => $isRequired() && (! $isConcealed()),
|
||||
'step' => $getStep(),
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
'maxlength' => (! $isConcealed) ? $getMaxLength() : null,
|
||||
'min' => (! $isConcealed) ? $getMinValue() : null,
|
||||
'minlength' => (! $isConcealed) ? $getMinLength() : null,
|
||||
'placeholder' => $getPlaceholder(),
|
||||
'placeholder' => ($getPlaceholder() === null) ? null : e((string) $getPlaceholder()),
|
||||
'readonly' => $isReadOnly(),
|
||||
'required' => $isRequired() && (! $isConcealed),
|
||||
'step' => $getStep(),
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
'id' => $getId(),
|
||||
'maxlength' => (! $isConcealed) ? $getMaxLength() : null,
|
||||
'minlength' => (! $isConcealed) ? $getMinLength() : null,
|
||||
'placeholder' => $getPlaceholder(),
|
||||
'placeholder' => ($getPlaceholder() === null) ? null : e((string) $getPlaceholder()),
|
||||
'readonly' => $isReadOnly(),
|
||||
'required' => $isRequired() && (! $isConcealed),
|
||||
'rows' => $rows,
|
||||
|
||||
Reference in New Issue
Block a user