Skip to content

Commit

Permalink
Enhance security for all url inside fields
Browse files Browse the repository at this point in the history
  • Loading branch information
ddurieux committed Nov 18, 2022
1 parent 2404cd7 commit bf9d252
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion inc/toolbox.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ function($element) {
'comment' => 1, // 1: remove HTML comments (and do not display their contents)
'cdata' => 1, // 1: remove CDATA sections (and do not display their contents)
'direct_list_nest' => 1, // 1: Allow usage of ul/ol tags nested in other ul/ol tags
'schemes' => '*: aim, app, feed, file, ftp, gopher, http, https, irc, mailto, news, nntp, sftp, ssh, tel, telnet, notes'
'safe' => 1,
];
if (!GLPI_ALLOW_IFRAME_IN_RICH_TEXT) {
$config['elements'] .= '-iframe';
Expand Down
2 changes: 2 additions & 0 deletions tests/units/Html.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ public function providerClean() {
['From: Test User <[email protected]>', 'From: Test User [email protected]', 'From: Test User [email protected]'],
// <a href="mailto:[email protected]"> should be preserved
['Email me @: <a href="mailto:[email protected]">[email protected]</a>', 'Email me @: [email protected]', 'Email me @: <a href="mailto:[email protected]">[email protected]</a>'],
// <a href="http://google.com"> should be preserved
['Website: <a href="http://google.com">http://google.com</a>', 'Website: http://google.com', 'Website: <a href="http://google.com">http://google.com</a>'],
];
}

Expand Down

0 comments on commit bf9d252

Please sign in to comment.