Skip to content

Commit

Permalink
[HtmlSanitizer] Some minor changes in the config API
Browse files Browse the repository at this point in the history
  • Loading branch information
javiereguiluz authored and fabpot committed Jan 7, 2022
1 parent ab5dcb7 commit ae23fc8
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion HtmlSanitizerConfig.php
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 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
2 changes: 1 addition & 1 deletion Tests/HtmlSanitizerAllTest.php
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
2 changes: 1 addition & 1 deletion TextSanitizer/StringSanitizer.php
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 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

0 comments on commit ae23fc8

Please sign in to comment.