diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
index 43f268db0670..5c953034faf7 100644
--- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
+++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
@@ -1912,7 +1912,7 @@ private function addHttpClientRetrySection()
->integerNode('max_delay')->defaultValue(0)->min(0)->info('Max time in ms that a retry should ever be delayed (0 = infinite)')->end()
->floatNode('jitter')->defaultValue(0.1)->min(0)->max(1)->info('Randomness in percent (between 0 and 1) to apply to the delay')->end()
->end()
- ;
+ ;
}
private function addMailerSection(ArrayNodeDefinition $rootNode, callable $enableIfStandalone)
@@ -2223,9 +2223,13 @@ private function addHtmlSanitizerSection(ArrayNodeDefinition $rootNode, callable
->info('Allows only a given list of schemes to be used in links href attributes.')
->scalarPrototype()->end()
->end()
- ->arrayNode('allowed_link_hosts')
+ ->variableNode('allowed_link_hosts')
->info('Allows only a given list of hosts to be used in links href attributes.')
- ->scalarPrototype()->end()
+ ->defaultValue(null)
+ ->validate()
+ ->ifTrue(function ($v) { return !\is_array($v) && null !== $v; })
+ ->thenInvalid('The "allowed_link_hosts" parameter must be an array or null')
+ ->end()
->end()
->booleanNode('allow_relative_links')
->info('Allows relative URLs to be used in links href attributes.')
@@ -2235,9 +2239,13 @@ private function addHtmlSanitizerSection(ArrayNodeDefinition $rootNode, callable
->info('Allows only a given list of schemes to be used in media source attributes (img, audio, video, ...).')
->scalarPrototype()->end()
->end()
- ->arrayNode('allowed_media_hosts')
+ ->variableNode('allowed_media_hosts')
->info('Allows only a given list of hosts to be used in media source attributes (img, audio, video, ...).')
- ->scalarPrototype()->end()
+ ->defaultValue(null)
+ ->validate()
+ ->ifTrue(function ($v) { return !\is_array($v) && null !== $v; })
+ ->thenInvalid('The "allowed_media_hosts" parameter must be an array or null')
+ ->end()
->end()
->booleanNode('allow_relative_medias')
->info('Allows relative URLs to be used in media source attributes (img, audio, video, ...).')
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/html_sanitizer_default_allowed_link_and_media_hosts.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/html_sanitizer_default_allowed_link_and_media_hosts.php
new file mode 100644
index 000000000000..952c066de0cc
--- /dev/null
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/html_sanitizer_default_allowed_link_and_media_hosts.php
@@ -0,0 +1,10 @@
+loadFromExtension('framework', [
+ 'http_method_override' => false,
+ 'html_sanitizer' => [
+ 'sanitizers' => [
+ 'custom_default' => null,
+ ],
+ ],
+]);
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/html_sanitizer_default_allowed_link_and_media_hosts.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/html_sanitizer_default_allowed_link_and_media_hosts.xml
new file mode 100644
index 000000000000..fff1592d37e0
--- /dev/null
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/html_sanitizer_default_allowed_link_and_media_hosts.xml
@@ -0,0 +1,13 @@
+
+
+
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: