Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Castopod
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Johannes Zellner
Castopod
Commits
78548b5c
Commit
78548b5c
authored
2 years ago
by
Yassine Doghri
Browse files
Options
Downloads
Patches
Plain Diff
fix: update form_textarea to prevent escaping value
replace form_markdown_textarea with form_textarea
parent
73ad94c1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/Helpers/form_helper.php
+6
-6
6 additions, 6 deletions
app/Helpers/form_helper.php
app/Views/Components/Forms/MarkdownEditor.php
+1
-1
1 addition, 1 deletion
app/Views/Components/Forms/MarkdownEditor.php
with
7 additions
and
7 deletions
app/Helpers/form_helper.php
+
6
−
6
View file @
78548b5c
...
@@ -2,14 +2,14 @@
...
@@ -2,14 +2,14 @@
declare
(
strict_types
=
1
);
declare
(
strict_types
=
1
);
if
(
!
function_exists
(
'form_
markdown_
textarea'
))
{
if
(
!
function_exists
(
'form_textarea'
))
{
/**
/**
*
T
extarea field
*
Adapted t
extarea 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')) {
...
@@ -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
"
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
app/Views/Components/Forms/MarkdownEditor.php
+
1
−
1
View file @
78548b5c
...
@@ -23,7 +23,7 @@ class MarkdownEditor extends FormComponent
...
@@ -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'
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment