8000 subdomains are also allowed on allowed hosts · symfony/symfony-docs@9e3d225 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9e3d225

Browse files
committed
subdomains are also allowed on allowed hosts
1 parent 7653443 commit 9e3d225

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

html_sanitizer.rst

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -730,8 +730,8 @@ URLs of ``<a>`` elements:
730730
allowed_link_schemes: ['http', 'https', 'mailto']
731731
732732
# specifies the allowed hosts, the attribute will be dropped if the
733-
# URL contains a different host
734-
allowed_link_hosts: ['symfony.com']
733+
# URL contains a different host which is not a subdomain of the allowed host
734+
allowed_link_hosts: ['symfony.com'] # also allows any subdomain (i.e. www.symfony.com)
735735
736736
# whether to allow relative links (i.e. URLs without scheme and host)
737737
allow_relative_links: true
@@ -763,7 +763,8 @@ URLs of ``<a>`` elements:
763763
<allowed-link-scheme>mailto</allowed-link-scheme>
764764
765765
<!-- specifies the allowed hosts, the attribute will be dropped if the
766-
URL contains a different host -->
766+
URL contains a different host which is not a subdomain of the allowed host
767+
Also allows any subdomain (i.e. www.symfony.com) -->
767768
<allowed-link-host>symfony.com</allowed-link-host>
768769
</framework:html-sanitizer>
769770
</framework:config>
@@ -786,8 +787,8 @@ URLs of ``<a>`` elements:
786787
->allowedLinkSchemes(['http', 'https', 'mailto'])
787788
788789
// specifies the allowed hosts, the attribute will be dropped if the
789-
// URL contains a different host
790-
->allowedLinkHost('symfony.com')
790+
// URL contains a different host which is not a subdomain of the allowed host
791+
->allowedLinkHost('symfony.com') // Also allows any subdomain (i.e. www.symfony.com)
791792
792793
// whether to allow relative links (i.e. URLs without scheme and host)
793794
->allowRelativeLinks(true) 10000
@@ -810,8 +811,8 @@ URLs of ``<a>`` elements:
810811
->allowedLinkSchemes(['http', 'https', 'mailto'])
811812
812813
// specifies the allowed hosts, the attribute will be dropped if the
813-
// URL contains a different host
814-
->allowedLinkHosts(['symfony.com'])
814+
// URL contains a different host which is not a subdomain of the allowed host
815+
->allowedLinkHosts(['symfony.com']) // Also allows any subdomain (i.e. www.symfony.com)
815816
816817
// whether to allow relative links (i.e. URLs without scheme and host)
817818
->allowRelativeLinks()
@@ -844,8 +845,8 @@ the HTML sanitizer: ``src``, ``href``, ``lowsrc``, ``background`` and ``ping``.
844845
allowed_media_schemes: ['http', 'https', 'mailto']
845846
846847
# specifies the allowed hosts, the attribute will be dropped if the URL
847-
# contains a different host
848-
allowed_media_hosts: ['symfony.com']
848+
# contains a different host which is not a subdomain of the allowed host
849+
allowed_media_hosts: ['symfony.com'] # Also allows any subdomain (i.e. www.symfony.com)
849850
850851
# whether to allow relative URLs (i.e. URLs without scheme and host)
851852
allow_relative_medias: true
@@ -877,7 +878,8 @@ the HTML sanitizer: ``src``, ``href``, ``lowsrc``, ``background`` and ``ping``.
877878
<allowed-media-scheme>mailto</allowed-media-scheme>
878879
879880
<!-- specifies the allowed hosts, the attribute will be dropped if the URL
880-
contains a different host -->
881+
contains a different host which is not a subdomain of the allowed host.
882+
Also allows any subdomain (i.e. www.symfony.com) -->
881883
<allowed-media-host>symfony.com</allowed-media-host>
882884
</framework:html-sanitizer>
883885
</framework:config>
@@ -900,8 +902,8 @@ the HTML sanitizer: ``src``, ``href``, ``lowsrc``, ``background`` and ``ping``.
900902
->allowedMediaSchemes(['http', 'https', 'mailto'])
901903
902904
// specifies the allowed hosts, the attribute will be dropped if the URL
903-
// contains a different host
904-
->allowedMediaHost('symfony.com')
905+
// contains a different host which is not a subdomain of the allowed host
906+
->allowedMediaHost('symfony.com') // Also allows any subdomain (i.e. www.symfony.com)
905907
906908
// whether to allow relative URLs (i.e. URLs without scheme and host)
907909
->allowRelativeMedias(true)
@@ -924,8 +926,8 @@ the HTML sanitizer: ``src``, ``href``, ``lowsrc``, ``background`` and ``ping``.
924926
->allowedMediaSchemes(['http', 'https', 'mailto'])
925927
926928
// specifies the allowed hosts, the attribute will be dropped if the URL
927-
// contains a different host
928-
->allowedMediaHosts(['symfony.com'])
929+
// contains a different host which is not a subdomain of the allowed host
930+
->allowedMediaHosts(['symfony.com']) // Also allows any subdomain (i.e. www.symfony.com)
929931
930932
// whether to allow relative URLs (i.e. URLs without scheme and host)
931933
->allowRelativeMedias()

0 commit comments

Comments
 (0)
0