From ae23fc8d06bdc763251ef479602587a0d3892705 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 --- HtmlSanitizerConfig.php | 2 +- README.md | 2 +- Tests/HtmlSanitizerAllTest.php | 2 +- TextSanitizer/StringSanitizer.php | 2 +- Visitor/DomVisitor.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/HtmlSanitizerConfig.php b/HtmlSanitizerConfig.php index 4782d3d..81a2812 100644 --- a/HtmlSanitizerConfig.php +++ b/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/README.md b/README.md index dba14d9..12210c8 100644 --- a/README.md +++ b/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/Tests/HtmlSanitizerAllTest.php b/Tests/HtmlSanitizerAllTest.php index b304081..7e53d8c 100644 --- a/Tests/HtmlSanitizerAllTest.php +++ b/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/TextSanitizer/StringSanitizer.php b/TextSanitizer/StringSanitizer.php index a291c62..99c5646 100644 --- a/TextSanitizer/StringSanitizer.php +++ b/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/Visitor/DomVisitor.php b/Visitor/DomVisitor.php index 30a8f0e..4c2eba0 100644 --- a/Visitor/DomVisitor.php +++ b/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> */