Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
aad86b66
Commit
aad86b66
authored
May 17, 2010
by
Francois Marier
Browse files
Pieforms: harden custom renderer against potential XSS attacks
Signed-off-by:
Francois Marier
<
francois@catalyst.net.nz
>
parent
649764b6
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/form/renderers/maharatable.php
View file @
aad86b66
...
@@ -62,10 +62,10 @@ function pieform_renderer_maharatable(Pieform $form, $element) {
...
@@ -62,10 +62,10 @@ function pieform_renderer_maharatable(Pieform $form, $element) {
$result
=
''
;
$result
=
''
;
if
(
isset
(
$element
[
'labelhtml'
])
&&
$element
[
'labelhtml'
]
!==
''
)
{
if
(
isset
(
$element
[
'labelhtml'
])
&&
$element
[
'labelhtml'
]
!==
''
)
{
$result
.
=
"
\t
<tr"
;
$result
.
=
"
\t
<tr"
;
$result
.
=
' id="'
.
$formname
.
'_'
.
$element
[
'name'
]
.
'_header"'
;
$result
.
=
' id="'
.
$formname
.
'_'
.
Pieform
::
hsc
(
$element
[
'name'
]
)
.
'_header"'
;
// Set the class of the enclosing <tr> to match that of the element
// Set the class of the enclosing <tr> to match that of the element
if
(
$element
[
'class'
])
{
if
(
$element
[
'class'
])
{
$result
.
=
' class="'
.
$element
[
'class'
]
.
'"'
;
$result
.
=
' class="'
.
Pieform
::
hsc
(
$element
[
'class'
]
)
.
'"'
;
}
}
$result
.
=
">
\n\t\t
"
;
$result
.
=
">
\n\t\t
"
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment