Skip to content

Commit 81d9509

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 352ab1f commit 81d9509

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
@@ -793,17 +793,17 @@ URLs of ``<a>`` elements:
793793
->sanitizer('app.post_sanitizer')
794794
// if `true`, all URLs using the `http://` scheme will be converted to
795795
// use the `https://` scheme instead. `http` still needs to be
796-
// allowed in `allowedLinkSchemes`
796+
// allowed in `allowLinkSchemes`
797797
->forceHttpsUrls(true)
798798
799799
// specifies the allowed URL schemes. If the URL has a different scheme, the
800800
// attribute will be dropped
801-
->allowedLinkSchemes(['http', 'https', 'mailto'])
801+
->allowLinkSchemes(['http', 'https', 'mailto'])
802802
803803
// specifies the allowed hosts, the attribute will be dropped if the
804804
// URL contains a different host. Subdomains are allowed: e.g. the following
805805
// config would also allow 'www.symfony.com', 'live.symfony.com', etc.
806-
->allowedLinkHosts(['symfony.com'])
806+
->allowLinkHosts(['symfony.com'])
807807
808808
// whether to allow relative links (i.e. URLs without scheme and host)
809809
->allowRelativeLinks(true)
@@ -819,16 +819,16 @@ URLs of ``<a>`` elements:
819819
(new HtmlSanitizerConfig())
820820
// if `true`, all URLs using the `http://` scheme will be converted to
821821
// use the `https://` scheme instead. `http` still needs to be
822-
// allowed in `allowedLinkSchemes`
822+
// allowed in `allowLinkSchemes`
823823
->forceHttpsUrls()
824824
825825
// specifies the allowed URL schemes. If the URL has a different scheme, the
826826
// attribute will be dropped
827-
->allowedLinkSchemes(['http', 'https', 'mailto'])
827+
->allowLinkSchemes(['http', 'https', 'mailto'])
828828
829829
// specifies the allowed hosts, the attribute will be dropped if the
830830
// URL contains a different host which is not a subdomain of the allowed host
831-
->allowedLinkHosts(['symfony.com']) // Also allows any subdomain (i.e. www.symfony.com)
831+
->allowLinkHosts(['symfony.com']) // Also allows any subdomain (i.e. www.symfony.com)
832832
833833
// whether to allow relative links (i.e. URLs without scheme and host)
834834
->allowRelativeLinks()
@@ -913,16 +913,16 @@ the HTML sanitizer: ``src``, ``href``, ``lowsrc``, ``background`` and ``ping``.
913913
->sanitizer('app.post_sanitizer')
914914
// if `true`, all URLs using the `http://` scheme will be converted to
915915
// use the `https://` scheme instead. `http` still needs to be
916-
// allowed in `allowedMediaSchemes`
916+
// allowed in `allowMediaSchemes`
917917
->forceHttpsUrls(true)
918918
919919
// specifies the allowed URL schemes. If the URL has a different scheme, the
920920
// attribute will be dropped
921-
->allowedMediaSchemes(['http', 'https', 'mailto'])
921+
->allowMediaSchemes(['http', 'https', 'mailto'])
922922
923923
// specifies the allowed hosts, the attribute will be dropped if the URL
924924
// contains a different host which is not a subdomain of the allowed host
925-
->allowedMediaHosts(['symfony.com']) // Also allows any subdomain (i.e. www.symfony.com)
925+
->allowMediaHosts(['symfony.com']) // Also allows any subdomain (i.e. www.symfony.com)
926926
927927
// whether to allow relative URLs (i.e. URLs without scheme and host)
928928
->allowRelativeMedias(true)
@@ -938,16 +938,16 @@ the HTML sanitizer: ``src``, ``href``, ``lowsrc``, ``background`` and ``ping``.
938938
(new HtmlSanitizerConfig())
939939
// if `true`, all URLs using the `http://` scheme will be converted to
940940
// use the `https://` scheme instead. `http` still needs to be
941-
// allowed in `allowedMediaSchemes`
941+
// allowed in `allowMediaSchemes`
942942
->forceHttpsUrls()
943943
944944
// specifies the allowed URL schemes. If the URL has a different scheme, the
945945
// attribute will be dropped
946-
->allowedMediaSchemes(['http', 'https', 'mailto'])
946+
->allowMediaSchemes(['http', 'https', 'mailto'])
947947
948948
// specifies the allowed hosts, the attribute will be dropped if the URL
949949
// contains a different host which is not a subdomain of the allowed host
950-
->allowedMediaHosts(['symfony.com']) // Also allows any subdomain (i.e. www.symfony.com)
950+
->allowMediaHosts(['symfony.com']) // Also allows any subdomain (i.e. www.symfony.com)
951951
952952
// whether to allow relative URLs (i.e. URLs without scheme and host)
953953
->allowRelativeMedias()

0 commit comments

Comments
 (0)