From 84470efbaaf1c1431d3b3427061c32310918b8e2 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Tue, 28 Dec 2021 09:05:24 +0100 Subject: [PATCH] [HtmlSanitizer] Some minor changes in the config API --- src/Symfony/Component/HtmlSanitizer/HtmlSanitizerConfig.php | 2 +- src/Symfony/Component/HtmlSanitizer/README.md | 2 +- .../Component/HtmlSanitizer/Tests/HtmlSanitizerAllTest.php | 2 +- .../Component/HtmlSanitizer/TextSanitizer/StringSanitizer.php | 2 +- src/Symfony/Component/HtmlSanitizer/Visitor/DomVisitor.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Component/HtmlSanitizer/HtmlSanitizerConfig.php b/src/Symfony/Component/HtmlSanitizer/HtmlSanitizerConfig.php index 4782d3dbc5d07..81a2812a5c862 100644 --- a/src/Symfony/Component/HtmlSanitizer/HtmlSanitizerConfig.php +++ b/src/Symfony/Component/HtmlSanitizer/HtmlSanitizerConfig.php @@ -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), diff --git a/src/Symfony/Component/HtmlSanitizer/README.md b/src/Symfony/Component/HtmlSanitizer/README.md index dba14d9ab8622..12210c8a87dba 100644 --- a/src/Symfony/Component/HtmlSanitizer/README.md +++ b/src/Symfony/Component/HtmlSanitizer/README.md @@ -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') diff --git a/src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerAllTest.php b/src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerAllTest.php index b3040817245c8..7e53d8c3a3207 100644 --- a/src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerAllTest.php +++ b/src/Symfony/Component/HtmlSanitizer/Tests/HtmlSanitizerAllTest.php @@ -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() diff --git a/src/Symfony/Component/HtmlSanitizer/TextSanitizer/StringSanitizer.php b/src/Symfony/Component/HtmlSanitizer/TextSanitizer/StringSanitizer.php index a291c622a136e..99c56469709e5 100644 --- a/src/Symfony/Component/HtmlSanitizer/TextSanitizer/StringSanitizer.php +++ b/src/Symfony/Component/HtmlSanitizer/TextSanitizer/StringSanitizer.php @@ -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 '+', '=', '@', diff --git a/src/Symfony/Component/HtmlSanitizer/Visitor/DomVisitor.php b/src/Symfony/Component/HtmlSanitizer/Visitor/DomVisitor.php index 30a8f0e2bbe9b..4c2eba0c16198 100644 --- a/src/Symfony/Component/HtmlSanitizer/Visitor/DomVisitor.php +++ b/src/Symfony/Component/HtmlSanitizer/Visitor/DomVisitor.php @@ -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> */