Skip to content

Commit 65c65a7

Browse files
committed
[HtmlSanitizer] fix PHP config examples
1 parent d5a33d8 commit 65c65a7

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

html_sanitizer.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ attributes from the `W3C Standard Proposal`_ are allowed.
370370
->allowElement('img', 'src')
371371
372372
// allow the <h1> element with all safe attributes
373-
->allowElement('h1')
373+
->allowElement('h1', '*')
374374
;
375375
};
376376
@@ -611,8 +611,7 @@ This option allows you to disallow attributes that were allowed before.
611611
$framework->htmlSanitizer()
612612
->sanitizer('app.post_sanitizer')
613613
// allow the "data-attr" on all safe elements...
614-
->allowAttribute('data-attr')
615-
->element('*')
614+
->allowAttribute('data-attr', '*')
616615
617616
// ...except for the <section> element
618617
->dropAttribute('data-attr', ['section'])
@@ -630,7 +629,7 @@ This option allows you to disallow attributes that were allowed before.
630629
$postSanitizer = new HtmlSanitizer(
631630
(new HtmlSanitizerConfig())
632631
// allow the "data-attr" on all safe elements...
633-
->allowAttribute('data-attr')
632+
->allowAttribute('data-attr', '*')
634633
635634
// ...except for the <section> element
636635
->dropAttribute('data-attr', ['section'])

0 commit comments

Comments
 (0)