Skip to content

Commit 204151c

Browse files
committed
Fix HTML Sanitizer method names in documentation
Changed incorrect method names from `allowed*` to `allow*`: - allowedLinkSchemes() → allowLinkSchemes() - allowedLinkHosts() → allowLinkHosts() - allowedMediaSchemes() → allowMediaSchemes() - allowedMediaHosts() → allowMediaHosts() These are the correct method names used in the HtmlSanitizerConfig class. Fixes #21211
1 parent 4d88042 commit 204151c

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

html_sanitizer.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -789,17 +789,17 @@ URLs of ``<a>`` elements:
789789
->sanitizer('app.post_sanitizer')
790790
// if `true`, all URLs using the `http://` scheme will be converted to
791791
// use the `https://` scheme instead. `http` still needs to be
792-
// allowed in `allowedLinkSchemes`
792+
// allowed in `allowLinkSchemes`
793793
->forceHttpsUrls(true)
794794
795795
// specifies the allowed URL schemes. If the URL has a different scheme, the
796796
// attribute will be dropped
797-
->allowedLinkSchemes(['http', 'https', 'mailto'])
797+
->allowLinkSchemes(['http', 'https', 'mailto'])
798798
799799
// specifies the allowed hosts, the attribute will be dropped if the
800800
// URL contains a different host. Subdomains are allowed: e.g. the following
801801
// config would also allow 'www.symfony.com', 'live.symfony.com', etc.
802-
->allowedLinkHosts(['symfony.com'])
802+
->allowLinkHosts(['symfony.com'])
803803
804804
// whether to allow relative links (i.e. URLs without scheme and host)
805805
->allowRelativeLinks(true)
@@ -815,16 +815,16 @@ URLs of ``<a>`` elements:
815815
(new HtmlSanitizerConfig())
816816
// if `true`, all URLs using the `http://` scheme will be converted to
817817
// use the `https://` scheme instead. `http` still needs to be
818-
// allowed in `allowedLinkSchemes`
818+
// allowed in `allowLinkSchemes`
819819
->forceHttpsUrls()
820820
821821
// specifies the allowed URL schemes. If the URL has a different scheme, the
822822
// attribute will be dropped
823-
->allowedLinkSchemes(['http', 'https', 'mailto'])
823+
->allowLinkSchemes(['http', 'https', 'mailto'])
824824
825825
// specifies the allowed hosts, the attribute will be dropped if the
826826
// URL contains a different host which is not a subdomain of the allowed host
827-
->allowedLinkHosts(['symfony.com']) // Also allows any subdomain (i.e. www.symfony.com)
827+
->allowLinkHosts(['symfony.com']) // Also allows any subdomain (i.e. www.symfony.com)
828828
829829
// whether to allow relative links (i.e. URLs without scheme and host)
830830
->allowRelativeLinks()
@@ -909,16 +909,16 @@ the HTML sanitizer: ``src``, ``href``, ``lowsrc``, ``background`` and ``ping``.
909909
->sanitizer('app.post_sanitizer')
910910
// if `true`, all URLs using the `http://` scheme will be converted to
911911
// use the `https://` scheme instead. `http` still needs to be
912-
// allowed in `allowedMediaSchemes`
912+
// allowed in `allowMediaSchemes`
913913
->forceHttpsUrls(true)
914914
915915
// specifies the allowed URL schemes. If the URL has a different scheme, the
916916
// attribute will be dropped
917-
->allowedMediaSchemes(['http', 'https', 'mailto'])
917+
->allowMediaSchemes(['http', 'https', 'mailto'])
918918
919919
// specifies the allowed hosts, the attribute will be dropped if the URL
920920
// contains a different host which is not a subdomain of the allowed host
921-
->allowedMediaHosts(['symfony.com']) // Also allows any subdomain (i.e. www.symfony.com)
921+
->allowMediaHosts(['symfony.com']) // Also allows any subdomain (i.e. www.symfony.com)
922922
923923
// whether to allow relative URLs (i.e. URLs without scheme and host)
924924
->allowRelativeMedias(true)
@@ -934,16 +934,16 @@ the HTML sanitizer: ``src``, ``href``, ``lowsrc``, ``background`` and ``ping``.
934934
(new HtmlSanitizerConfig())
935935
// if `true`, all URLs using the `http://` scheme will be converted to
936936
// use the `https://` scheme instead. `http` still needs to be
937-
// allowed in `allowedMediaSchemes`
937+
// allowed in `allowMediaSchemes`
938938
->forceHttpsUrls()
939939
940940
// specifies the allowed URL schemes. If the URL has a different scheme, the
941941
// attribute will be dropped
942-
->allowedMediaSchemes(['http', 'https', 'mailto'])
942+
->allowMediaSchemes(['http', 'https', 'mailto'])
943943
944944
// specifies the allowed hosts, the attribute will be dropped if the URL
945945
// contains a different host which is not a subdomain of the allowed host
946-
->allowedMediaHosts(['symfony.com']) // Also allows any subdomain (i.e. www.symfony.com)
946+
->allowMediaHosts(['symfony.com']) // Also allows any subdomain (i.e. www.symfony.com)
947947
948948
// whether to allow relative URLs (i.e. URLs without scheme and host)
949949
->allowRelativeMedias()

0 commit comments

Comments
 (0)