Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
1e5fb3e3
Commit
1e5fb3e3
authored
Jan 25, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
www: add html_safe() for even safer html
parent
68bb3fa5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
guiconfig.inc
src/www/guiconfig.inc
+7
-1
system_information.widget.php
src/www/widgets/widgets/system_information.widget.php
+1
-1
No files found.
src/www/guiconfig.inc
View file @
1e5fb3e3
<?php
/*
Copyright (C) 2015 Franco Fichtner <franco@opnsense.org>
Copyright (C) 2015
-2016
Franco Fichtner <franco@opnsense.org>
Copyright (C) 2014 Deciso B.V.
Copyright (C) 2004 Scott Ullrich
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
...
...
@@ -73,6 +73,12 @@ function get_current_theme()
return
$theme
;
}
function
html_safe
(
$text
)
{
/* gettext() embedded in JavaScript can cause syntax errors */
return
htmlspecialchars
(
$text
,
ENT_QUOTES
|
ENT_HTML401
);
}
/* make sure nothing is cached */
if
(
isset
(
$omit_nocacheheaders
)
&&
$omit_nocacheheaders
)
{
header
(
"Expires: 0"
);
...
...
src/www/widgets/widgets/system_information.widget.php
View file @
1e5fb3e3
...
...
@@ -273,7 +273,7 @@ endforeach; ?>
<script
type=
"text/javascript"
>
//
<!
[
CDATA
[
function
checkupdate
()
{
jQuery
(
'
#updatestatus
'
).
html
(
'
<span class="text-info">
<?=
gettext
(
'Fetching... (may take up to 30 seconds)'
)
?>
</span>
'
);
jQuery
(
'
#updatestatus
'
).
html
(
'
<span class="text-info">
<?=
html_safe
(
gettext
(
'Fetching... (may take up to 30 seconds)'
)
)
?>
</span>
'
);
jQuery
.
ajax
({
type
:
"
POST
"
,
url
:
'
/widgets/widgets/system_information.widget.php
'
,
...
...
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