@@ -731,7 +731,8 @@ URLs of ``<a>`` elements:
731
731
allowed_link_schemes : ['http', 'https', 'mailto']
732
732
733
733
# specifies the allowed hosts, the attribute will be dropped if the
734
- # URL contains a different host
734
+ # URL contains a different host. Subdomains are allowed: e.g. the following
735
+ # config would also allow 'www.symfony.com', 'live.symfony.com', etc.
735
736
allowed_link_hosts : ['symfony.com']
736
737
737
738
# whether to allow relative links (i.e. URLs without scheme and host)
@@ -765,7 +766,8 @@ URLs of ``<a>`` elements:
765
766
<allowed-link-scheme >mailto</allowed-link-scheme >
766
767
767
768
<!-- specifies the allowed hosts, the attribute will be dropped if the
768
- URL contains a different host -->
769
+ URL contains a different host. Subdomains are allowed: e.g. the following
770
+ config would also allow 'www.symfony.com', 'live.symfony.com', etc. -->
769
771
<allowed-link-host >symfony.com</allowed-link-host >
770
772
</framework : html-sanitizer >
771
773
</framework : config >
@@ -789,7 +791,8 @@ URLs of ``<a>`` elements:
789
791
->allowedLinkSchemes(['http', 'https', 'mailto'])
790
792
791
793
// specifies the allowed hosts, the attribute will be dropped if the
792
- // URL contains a different host
794
+ // URL contains a different host. Subdomains are allowed: e.g. the following
795
+ // config would also allow 'www.symfony.com', 'live.symfony.com', etc.
793
796
->allowedLinkHost('symfony.com')
794
797
795
798
// whether to allow relative links (i.e. URLs without scheme and host)
@@ -814,8 +817,8 @@ URLs of ``<a>`` elements:
814
817
->allowedLinkSchemes(['http', 'https', 'mailto'])
815
818
816
819
// specifies the allowed hosts, the attribute will be dropped if the
817
- // URL contains a different host
818
- ->allowedLinkHosts(['symfony.com'])
820
+ // URL contains a different host which is not a subdomain of the allowed host
821
+ ->allowedLinkHosts(['symfony.com']) // Also allows any subdomain (i.e. www.symfony.com)
819
822
820
823
// whether to allow relative links (i.e. URLs without scheme and host)
821
824
->allowRelativeLinks()
@@ -849,8 +852,8 @@ the HTML sanitizer: ``src``, ``href``, ``lowsrc``, ``background`` and ``ping``.
849
852
allowed_media_schemes : ['http', 'https', 'mailto']
850
853
851
854
# specifies the allowed hosts, the attribute will be dropped if the URL
852
- # contains a different host
853
- allowed_media_hosts : ['symfony.com']
855
+ # contains a different host which is not a subdomain of the allowed host
856
+ allowed_media_hosts : ['symfony.com'] # Also allows any subdomain (i.e. www.symfony.com)
854
857
855
858
# whether to allow relative URLs (i.e. URLs without scheme and host)
856
859
allow_relative_medias : true
@@ -883,7 +886,8 @@ the HTML sanitizer: ``src``, ``href``, ``lowsrc``, ``background`` and ``ping``.
883
886
<allowed-media-scheme >mailto</allowed-media-scheme >
884
887
885
888
<!-- specifies the allowed hosts, the attribute will be dropped if the URL
886
- contains a different host -->
889
+ contains a different host which is not a subdomain of the allowed host.
890
+ Also allows any subdomain (i.e. www.symfony.com) -->
887
891
<allowed-media-host >symfony.com</allowed-media-host >
888
892
</framework : html-sanitizer >
889
893
</framework : config >
@@ -907,8 +911,8 @@ the HTML sanitizer: ``src``, ``href``, ``lowsrc``, ``background`` and ``ping``.
907
911
->allowedMediaSchemes(['http', 'https', 'mailto'])
908
912
909
913
// specifies the allowed hosts, the attribute will be dropped if the URL
910
- // contains a different host
911
- ->allowedMediaHost('symfony.com')
914
+ // contains a different host which is not a subdomain of the allowed host
915
+ ->allowedMediaHost('symfony.com') // Also allows any subdomain (i.e. www.symfony.com)
912
916
913
917
// whether to allow relative URLs (i.e. URLs without scheme and host)
914
918
->allowRelativeMedias(true)
@@ -932,8 +936,8 @@ the HTML sanitizer: ``src``, ``href``, ``lowsrc``, ``background`` and ``ping``.
932
936
->allowedMediaSchemes(['http', 'https', 'mailto'])
933
937
934
938
// specifies the allowed hosts, the attribute will be dropped if the URL
935
- // contains a different host
936
- ->allowedMediaHosts(['symfony.com'])
939
+ // contains a different host which is not a subdomain of the allowed host
940
+ ->allowedMediaHosts(['symfony.com']) // Also allows any subdomain (i.e. www.symfony.com)
937
941
938
942
// whether to allow relative URLs (i.e. URLs without scheme and host)
939
943
->allowRelativeMedias()
0 commit comments