mirror of
https://code.castopod.org/adaures/castopod.git
synced 2024-09-30 05:31:22 +02:00
fix: update form_textarea to prevent escaping value
replace form_markdown_textarea with form_textarea
This commit is contained in:
parent
73ad94c1d5
commit
78548b5cd7
@ -2,14 +2,14 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
if (! function_exists('form_markdown_textarea')) {
|
if (! function_exists('form_textarea')) {
|
||||||
/**
|
/**
|
||||||
* Textarea field
|
* Adapted textarea field from CI4 core: without value escaping.
|
||||||
*
|
*
|
||||||
* @param mixed $data
|
* @param mixed $data
|
||||||
* @param mixed $extra
|
* @param mixed $extra
|
||||||
*/
|
*/
|
||||||
function form_markdown_textarea($data = '', string $value = '', $extra = ''): string
|
function form_textarea($data = '', string $value = '', $extra = ''): string
|
||||||
{
|
{
|
||||||
$defaults = [
|
$defaults = [
|
||||||
'name' => is_array($data) ? '' : $data,
|
'name' => is_array($data) ? '' : $data,
|
||||||
@ -38,9 +38,9 @@ if (! function_exists('form_markdown_textarea')) {
|
|||||||
unset($defaults['cols']);
|
unset($defaults['cols']);
|
||||||
}
|
}
|
||||||
|
|
||||||
return '<textarea ' . rtrim(parse_form_attributes($data, $defaults)) . stringify_attributes($extra) . '>'
|
return '<textarea ' . rtrim(parse_form_attributes($data, $defaults)) . stringify_attributes(
|
||||||
. $val
|
$extra
|
||||||
. "</textarea>\n";
|
) . '>' . $val . "</textarea>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ class MarkdownEditor extends FormComponent
|
|||||||
$this->attributes['class'] = 'bg-elevated border-none focus:border-none focus:outline-none focus:ring-0 w-full h-full';
|
$this->attributes['class'] = 'bg-elevated border-none focus:border-none focus:outline-none focus:ring-0 w-full h-full';
|
||||||
$this->attributes['rows'] = 6;
|
$this->attributes['rows'] = 6;
|
||||||
|
|
||||||
$textarea = form_markdown_textarea($this->attributes, old($this->name, $this->value));
|
$textarea = form_textarea($this->attributes, old($this->name, $this->value));
|
||||||
$markdownIcon = icon(
|
$markdownIcon = icon(
|
||||||
'markdown',
|
'markdown',
|
||||||
'mr-1 text-lg opacity-40'
|
'mr-1 text-lg opacity-40'
|
||||||
|
Loading…
Reference in New Issue
Block a user