Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
wp-forms
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wpdesk
wp-forms
Merge requests
!20
Feature/add escaping to templates
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
Feature/add escaping to templates
feature/add-escaping-to-templates
into
master
Overview
0
Commits
3
Pipelines
1
Changes
22
Merged
Krzysztof Dyszczyk
requested to merge
feature/add-escaping-to-templates
into
master
3 years ago
Overview
0
Commits
3
Pipelines
1
Changes
22
0
0
Merge request reports
Viewing commit
3b888336
Prev
Next
Show latest version
22 files
+
342
−
207
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
22
3b888336
fix(templates): add escaping templates from wp-forms 3.0
· 3b888336
Marcin Kolanko
authored
3 years ago
templates/button.php
+
18
−
14
View file @ 3b888336
Edit in single-file editor
Open in Web IDE
Show full file
@@ -4,28 +4,32 @@
* @var \WPDesk\View\Renderer\Renderer $renderer
* @var string $name_prefix
* @var string $value
*
* @var string $template_name Real field template.
*
*/
?>
<button
<?php
if
(
$field
->
has_classes
()
)
:
?>
class=
"
<?php
echo
\esc_attr
(
$field
->
get_classes
());
?>
"
<?php
if
(
$field
->
has_classes
()
)
:
?>
class=
"
<?php
echo
\esc_attr
(
$field
->
get_classes
()
);
?>
"
<?php
endif
;
?>
<?php
foreach
(
$field
->
get_attributes
([])
as
$key
=>
$val
)
:
?>
<?php
echo
$key
.
'="'
.
\esc_attr
(
$val
)
.
'"'
;
?>
<?php
foreach
(
$field
->
get_attributes
(
[]
)
as
$key
=>
$val
)
:
?>
<?php
echo
\esc_attr
(
$key
)
.
'="'
.
\esc_attr
(
$val
)
.
'"'
;
?>
<?php
endforeach
;
?>
type=
"
<?php
echo
\esc_attr
(
$field
->
get_type
());
?>
"
name=
"
<?php
echo
\esc_attr
(
$name_prefix
)
.
'['
.
\esc_attr
(
$field
->
get_name
()
)
.
']'
?>
"
id=
"
<?php
echo
\esc_attr
(
$field
->
get_id
());
?>
"
value=
"
<?php
echo
\esc_html
(
$value
);
?>
"
type=
"
<?php
echo
\esc_attr
(
$field
->
get_type
()
);
?>
"
name=
"
<?php
echo
\esc_attr
(
$name_prefix
)
.
'['
.
\esc_attr
(
$field
->
get_name
()
)
.
']'
;
?>
"
id=
"
<?php
echo
\esc_attr
(
$field
->
get_id
()
);
?>
"
value=
"
<?php
echo
\esc_html
(
$value
);
?>
"
<?php
if
(
$field
->
is_required
())
:
?>
required=
"required"
<?php
endif
;
?>
<?php
if
(
$field
->
is_disabled
())
:
?>
disabled=
"disabled"
<?php
endif
;
?>
<?php
if
(
$field
->
is_readonly
())
:
?>
readonly=
"readonly"
<?php
endif
;
?>
<?php
if
(
$field
->
is_disabled
()
)
:
?>
disabled=
"disabled"
<?php
endif
;
?>
<?php
if
(
$field
->
is_readonly
()
)
:
?>
readonly=
"readonly"
<?php
endif
;
?>
>
<?php
echo
\esc_html
(
$field
->
get_label
());
?>
</button>
>
<?php
echo
\esc_html
(
$field
->
get_label
()
);
?>
</button>
Loading