Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 38d7c21

Browse files
committed
[HtmlSanitizer][FrameworkBundle] Fix calling allowStaticElements when setting allow_all_static_elements: true
1 parent 786e71c commit 38d7c21

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2149,7 +2149,7 @@ private function addHtmlSanitizerSection(ArrayNodeDefinition $rootNode, callable
21492149
->info('Allows "safe" elements and attributes.')
21502150
->defaultFalse()
21512151
->end()
2152-
->booleanNode('allow_all_static_elements')
2152+
->booleanNode('allow_static_elements')
21532153
->info('Allows all static elements and attributes from the W3C Sanitizer API standard.')
21542154
->defaultFalse()
21552155
->end()

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2682,8 +2682,8 @@ private function registerHtmlSanitizerConfiguration(array $config, ContainerBuil
26822682
$def->addMethodCall('allowSafeElements', [], true);
26832683
}
26842684

2685-
if ($sanitizerConfig['allow_all_static_elements']) {
2686-
$def->addMethodCall('allowAllStaticElements', [], true);
2685+
if ($sanitizerConfig['allow_static_elements']) {
2686+
$def->addMethodCall('allowStaticElements', [], true);
26872687
}
26882688

26892689
// Configures elements

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/html_sanitizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
'sanitizers' => [
77
'default' => [
88
'allow_safe_elements' => true,
9-
'allow_all_static_elements' => true,
9+
'allow_static_elements' => true,
1010
'allow_elements' => [
1111
'iframe' => 'src',
1212
'custom-tag' => ['data-attr', 'data-attr-1'],

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/html_sanitizer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ framework:
44
sanitizers:
55
default:
66
allow_safe_elements: true
7-
allow_all_static_elements: true
7+
allow_static_elements: true
88
allow_elements:
99
iframe: 'src'
1010
custom-tag: ['data-attr', 'data-attr-1']

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2045,7 +2045,7 @@ public function testHtmlSanitizer()
20452045
$this->assertSame(
20462046
[
20472047
['allowSafeElements', [], true],
2048-
['allowAllStaticElements', [], true],
2048+
['allowStaticElements', [], true],
20492049
['allowElement', ['iframe', 'src'], true],
20502050
['allowElement', ['custom-tag', ['data-attr', 'data-attr-1']], true],
20512051
['allowElement', ['custom-tag-2', '*'], true],

0 commit comments

Comments
 (0)