Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
299
Merge Requests
299
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
08344875
Commit
08344875
authored
Jun 06, 2015
by
xjm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2501403
by Cottser, xjm, pwolanin, joelpittet: Document SafeMarkup::set in Xss::filter
parent
2b20dd20
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
core/lib/Drupal/Component/Utility/Xss.php
core/lib/Drupal/Component/Utility/Xss.php
+4
-0
No files found.
core/lib/Drupal/Component/Utility/Xss.php
View file @
08344875
...
...
@@ -79,6 +79,10 @@ public static function filter($string, $html_tags = array('a', 'em', 'strong', '
$splitter
=
function
(
$matches
)
use
(
$html_tags
,
$class
)
{
return
$class
::
split
(
$matches
[
1
],
$html_tags
,
$class
);
};
// Strip any tags that are not in the whitelist, then mark the text as safe
// for output. All other known XSS vectors have been filtered out by this
// point and any HTML tags remaining will have been deliberately allowed, so
// it is acceptable to call SafeMarkup::set() on the resultant string.
return
SafeMarkup
::
set
(
preg_replace_callback
(
'%
(
<(?=[^a-zA-Z!/]) # a lone <
...
...
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