-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
minor #44814 [HtmlSanitizer] Some minor changes in the config API (ja…
…viereguiluz) This PR was squashed before being merged into the 6.1 branch. Discussion ---------- [HtmlSanitizer] Some minor changes in the config API | Q | A | ------------- | --- | Branch? | 6.1 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - First of all, thanks to @tgalopin for this superb contribution 🙇 This PR makes 3 little changes: (1) Fix two minor typos (2) Rename `allowAllStaticElements()` as `allowStaticElements()` to be consistent with the rest of methods, which don't include the `All` word. (3) A proposal to change this default value: ```diff -public function allowElement(string $element, array|string $allowedAttributes = []): static +public function allowElement(string $element, array|string $allowedAttributes = '*'): static ``` In my opinion, when you want to allow some element, most of the times you want to allow the standard attributes on them too. So, the following should allow `<div>` and their standard attributes: ```php ->allowElement('div') ``` Forcing to write it as `->allowElement('div', '*')` seems cumbersome. The previous behavior (forbid all attributes) would now be like this: ```php ->allowElement('div', []) ``` Commits ------- 84470efbaa [HtmlSanitizer] Some minor changes in the config API
- Loading branch information
Showing
5 changed files
with
5 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters