Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
die_coolen_jungs
our_own_cloud_project
Commits
4b293dff
Commit
4b293dff
authored
Dec 08, 2015
by
Lukas Reschke
Browse files
Use \OCP\Util::sanitizeHTML instead of \OC_Util::sanitizeHTML
parent
70c228a7
Changes
6
Hide whitespace changes
Inline
Side-by-side
core/templates/login.php
View file @
4b293dff
...
...
@@ -12,7 +12,7 @@ script('core', [
<form
method=
"post"
name=
"login"
>
<fieldset>
<?php
if
(
!
empty
(
$_
[
'redirect_url'
]))
{
print_unescaped
(
'<input type="hidden" name="redirect_url" value="'
.
OC
_
Util
::
sanitizeHTML
(
$_
[
'redirect_url'
])
.
'">'
);
print_unescaped
(
'<input type="hidden" name="redirect_url" value="'
.
\
OC
P\
Util
::
sanitizeHTML
(
$_
[
'redirect_url'
])
.
'">'
);
}
?>
<?php
if
(
isset
(
$_
[
'apacheauthfailed'
])
&&
(
$_
[
'apacheauthfailed'
]))
:
?>
<div
class=
"warning"
>
...
...
lib/private/template.php
View file @
4b293dff
...
...
@@ -226,12 +226,12 @@ class OC_Template extends \OC\Template\Base {
// Add custom headers
$headers
=
''
;
foreach
(
OC_Util
::
$headers
as
$header
)
{
$headers
.
=
'<'
.
OC
_
Util
::
sanitizeHTML
(
$header
[
'tag'
]);
$headers
.
=
'<'
.
\
OC
P\
Util
::
sanitizeHTML
(
$header
[
'tag'
]);
foreach
(
$header
[
'attributes'
]
as
$name
=>
$value
)
{
$headers
.
=
' '
.
OC
_
Util
::
sanitizeHTML
(
$name
)
.
'="'
.
OC
_
Util
::
sanitizeHTML
(
$value
)
.
'"'
;
$headers
.
=
' '
.
\
OC
P\
Util
::
sanitizeHTML
(
$name
)
.
'="'
.
\
OC
P\
Util
::
sanitizeHTML
(
$value
)
.
'"'
;
}
if
(
$header
[
'text'
]
!==
null
)
{
$headers
.
=
'>'
.
OC
_
Util
::
sanitizeHTML
(
$header
[
'text'
])
.
'</'
.
OC
_
Util
::
sanitizeHTML
(
$header
[
'tag'
])
.
'>'
;
$headers
.
=
'>'
.
\
OC
P\
Util
::
sanitizeHTML
(
$header
[
'text'
])
.
'</'
.
\
OC
P\
Util
::
sanitizeHTML
(
$header
[
'tag'
])
.
'>'
;
}
else
{
$headers
.
=
'/>'
;
}
...
...
lib/private/template/functions.php
View file @
4b293dff
...
...
@@ -33,7 +33,7 @@
* @param string $string the string which will be escaped and printed
*/
function
p
(
$string
)
{
print
(
OC
_
Util
::
sanitizeHTML
(
$string
));
print
(
\
OC
P\
Util
::
sanitizeHTML
(
$string
));
}
/**
...
...
@@ -262,7 +262,7 @@ function html_select_options($options, $selected, $params=array()) {
$label
=
$label
[
$label_name
];
}
$select
=
in_array
(
$value
,
$selected
)
?
' selected="selected"'
:
''
;
$html
.
=
'<option value="'
.
OC
_
Util
::
sanitizeHTML
(
$value
)
.
'"'
.
$select
.
'>'
.
OC
_
Util
::
sanitizeHTML
(
$label
)
.
'</option>'
.
"
\n
"
;
$html
.
=
'<option value="'
.
\
OC
P\
Util
::
sanitizeHTML
(
$value
)
.
'"'
.
$select
.
'>'
.
\
OC
P\
Util
::
sanitizeHTML
(
$label
)
.
'</option>'
.
"
\n
"
;
}
return
$html
;
}
lib/public/util.php
View file @
4b293dff
...
...
@@ -497,11 +497,11 @@ class Util {
* string or array of strings before displaying it on a web page.
*
* @param string|array $value
* @return string|array an array of sanitized strings or a single s
i
nitized string, depends on the input parameter.
* @return string|array an array of sanitized strings or a single s
a
nitized string, depends on the input parameter.
* @since 4.5.0
*/
public
static
function
sanitizeHTML
(
$value
)
{
return
(
\
OC_Util
::
sanitizeHTML
(
$value
)
)
;
public
static
function
sanitizeHTML
(
$value
)
{
return
\
OC_Util
::
sanitizeHTML
(
$value
);
}
/**
...
...
settings/templates/admin.php
View file @
4b293dff
...
...
@@ -56,7 +56,7 @@ if ($_['mail_smtpmode'] == 'qmail') {
if
(
isset
(
$form
[
'anchor'
]))
{
$anchor
=
'#'
.
$form
[
'anchor'
];
$sectionName
=
$form
[
'section-name'
];
print_unescaped
(
sprintf
(
"<li><a href='%s'>%s</a></li>"
,
OC
_
Util
::
sanitizeHTML
(
$anchor
),
OC
_
Util
::
sanitizeHTML
(
$sectionName
)));
print_unescaped
(
sprintf
(
"<li><a href='%s'>%s</a></li>"
,
\
OC
P\
Util
::
sanitizeHTML
(
$anchor
),
\
OC
P\
Util
::
sanitizeHTML
(
$sectionName
)));
}
}
?>
</ul>
...
...
settings/templates/personal.php
View file @
4b293dff
...
...
@@ -14,7 +14,7 @@
if
(
isset
(
$form
[
'anchor'
]))
{
$anchor
=
'#'
.
$form
[
'anchor'
];
$sectionName
=
$form
[
'section-name'
];
print_unescaped
(
sprintf
(
"<li><a href='%s'>%s</a></li>"
,
OC
_
Util
::
sanitizeHTML
(
$anchor
),
OC
_
Util
::
sanitizeHTML
(
$sectionName
)));
print_unescaped
(
sprintf
(
"<li><a href='%s'>%s</a></li>"
,
\
OC
P\
Util
::
sanitizeHTML
(
$anchor
),
\
OC
P\
Util
::
sanitizeHTML
(
$sectionName
)));
}
}
?>
</ul>
...
...
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