Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[HtmlSanitizer] Some minor changes in the config API #44814

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function __construct()
* All scripts will be removed but the output may still contain other dangerous
* behaviors like CSS injection (click-jacking), CSS expressions, ...
*/
public function allowAllStaticElements(): static
public function allowStaticElements(): static
{
$elements = array_merge(
array_keys(W3CReference::HEAD_ELEMENTS),
Expand Down
2 changes: 1 addition & 1 deletion 2 src/Symfony/Component/HtmlSanitizer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ $config = (new HtmlSanitizerConfig())
// standard. All scripts will be removed but the output may still contain
// other dangerous behaviors like CSS injection (click-jacking), CSS
// expressions, ...
->allowAllStaticElements()
->allowStaticElements()

// Allow the "div" element and no attribute can be on it
->allowElement('div')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ private function createSanitizer(): HtmlSanitizer
{
return new HtmlSanitizer(
(new HtmlSanitizerConfig())
->allowAllStaticElements()
->allowStaticElements()
->allowLinkHosts(['trusted.com', 'external.com'])
->allowMediaHosts(['trusted.com', 'external.com'])
->allowRelativeLinks()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ final class StringSanitizer
// """ is shorter than """
'"',

// Fix several potential issues in how browsers intepret attributes values
// Fix several potential issues in how browsers interpret attributes values
'+',
'=',
'@',
Expand Down
2 changes: 1 addition & 1 deletion 2 src/Symfony/Component/HtmlSanitizer/Visitor/DomVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ final class DomVisitor
private array $elementsConfig;

/**
* Registry of attributes to forcefuly set on nodes, index by element and attribute.
* Registry of attributes to forcefully set on nodes, index by element and attribute.
*
* @var array<string, array<string, string>>
*/
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.