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

Skip to content

Commit 98a4b8a

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

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
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/Resources/config/schema/symfony-1.0.xsd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@
845845
</xsd:sequence>
846846
<xsd:attribute name="name" type="xsd:string" use="required" />
847847
<xsd:attribute name="allow-safe-elements" type="xsd:boolean" />
848-
<xsd:attribute name="allow-all-static-elements" type="xsd:boolean" />
848+
<xsd:attribute name="allow-static-elements" type="xsd:boolean" />
849849
<xsd:attribute name="force-https-urls" type="xsd:boolean" />
850850
<xsd:attribute name="allow-relative-links" type="xsd:boolean" />
851851
<xsd:attribute name="allow-relative-medias" type="xsd:boolean" />

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/xml/html_sanitizer.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<html-sanitizer>
1010
<sanitizer name="default"
1111
allow-safe-elements="true"
12-
allow-all-static-elements="true"
12+
allow-static-elements="true"
1313
force-https-urls="true"
1414
allow-relative-links="true"
1515
allow-relative-medias="true"

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)