From 81d9509f20c6ecbf9d87bd5708156786cf2f9e2e Mon Sep 17 00:00:00 2001 From: Oskar Stark Date: Fri, 18 Jul 2025 09:34:53 +0200 Subject: [PATCH] Fix HTML Sanitizer method names in documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 symfony/symfony-docs#21211 --- html_sanitizer.rst | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/html_sanitizer.rst b/html_sanitizer.rst index 17096db913f..07ba9b567de 100644 --- a/html_sanitizer.rst +++ b/html_sanitizer.rst @@ -793,17 +793,17 @@ URLs of ```` elements: ->sanitizer('app.post_sanitizer') // if `true`, all URLs using the `http://` scheme will be converted to // use the `https://` scheme instead. `http` still needs to be - // allowed in `allowedLinkSchemes` + // allowed in `allowLinkSchemes` ->forceHttpsUrls(true) // specifies the allowed URL schemes. If the URL has a different scheme, the // attribute will be dropped - ->allowedLinkSchemes(['http', 'https', 'mailto']) + ->allowLinkSchemes(['http', 'https', 'mailto']) // specifies the allowed hosts, the attribute will be dropped if the // URL contains a different host. Subdomains are allowed: e.g. the following // config would also allow 'www.symfony.com', 'live.symfony.com', etc. - ->allowedLinkHosts(['symfony.com']) + ->allowLinkHosts(['symfony.com']) // whether to allow relative links (i.e. URLs without scheme and host) ->allowRelativeLinks(true) @@ -819,16 +819,16 @@ URLs of ```` elements: (new HtmlSanitizerConfig()) // if `true`, all URLs using the `http://` scheme will be converted to // use the `https://` scheme instead. `http` still needs to be - // allowed in `allowedLinkSchemes` + // allowed in `allowLinkSchemes` ->forceHttpsUrls() // specifies the allowed URL schemes. If the URL has a different scheme, the // attribute will be dropped - ->allowedLinkSchemes(['http', 'https', 'mailto']) + ->allowLinkSchemes(['http', 'https', 'mailto']) // specifies the allowed hosts, the attribute will be dropped if the // URL contains a different host which is not a subdomain of the allowed host - ->allowedLinkHosts(['symfony.com']) // Also allows any subdomain (i.e. www.symfony.com) + ->allowLinkHosts(['symfony.com']) // Also allows any subdomain (i.e. www.symfony.com) // whether to allow relative links (i.e. URLs without scheme and host) ->allowRelativeLinks() @@ -913,16 +913,16 @@ the HTML sanitizer: ``src``, ``href``, ``lowsrc``, ``background`` and ``ping``. ->sanitizer('app.post_sanitizer') // if `true`, all URLs using the `http://` scheme will be converted to // use the `https://` scheme instead. `http` still needs to be - // allowed in `allowedMediaSchemes` + // allowed in `allowMediaSchemes` ->forceHttpsUrls(true) // specifies the allowed URL schemes. If the URL has a different scheme, the // attribute will be dropped - ->allowedMediaSchemes(['http', 'https', 'mailto']) + ->allowMediaSchemes(['http', 'https', 'mailto']) // specifies the allowed hosts, the attribute will be dropped if the URL // contains a different host which is not a subdomain of the allowed host - ->allowedMediaHosts(['symfony.com']) // Also allows any subdomain (i.e. www.symfony.com) + ->allowMediaHosts(['symfony.com']) // Also allows any subdomain (i.e. www.symfony.com) // whether to allow relative URLs (i.e. URLs without scheme and host) ->allowRelativeMedias(true) @@ -938,16 +938,16 @@ the HTML sanitizer: ``src``, ``href``, ``lowsrc``, ``background`` and ``ping``. (new HtmlSanitizerConfig()) // if `true`, all URLs using the `http://` scheme will be converted to // use the `https://` scheme instead. `http` still needs to be - // allowed in `allowedMediaSchemes` + // allowed in `allowMediaSchemes` ->forceHttpsUrls() // specifies the allowed URL schemes. If the URL has a different scheme, the // attribute will be dropped - ->allowedMediaSchemes(['http', 'https', 'mailto']) + ->allowMediaSchemes(['http', 'https', 'mailto']) // specifies the allowed hosts, the attribute will be dropped if the URL // contains a different host which is not a subdomain of the allowed host - ->allowedMediaHosts(['symfony.com']) // Also allows any subdomain (i.e. www.symfony.com) + ->allowMediaHosts(['symfony.com']) // Also allows any subdomain (i.e. www.symfony.com) // whether to allow relative URLs (i.e. URLs without scheme and host) ->allowRelativeMedias()