Skip to content

[HtmlSanitizer] Fix method names #21216

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 6.4
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions html_sanitizer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -793,22 +793,22 @@
->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'])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the DI configuration this is not the correct change, right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed. That's why the CI fails


// 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'])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here


// whether to allow relative links (i.e. URLs without scheme and host)
->allowRelativeLinks(true)
;
};

Check failure on line 811 in html_sanitizer.rst

View workflow job for this annotation

GitHub Actions / Code Blocks

[Cache Warmup] 2025-07-18T07:38:44+00:00 [info] User Deprecated: Method "Symfony\Component\HttpKernel\Bundle\Bundle::build()" might add "void" as a native return type declaration in the future. Do the same in child class "Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle" now to avoid errors or add an explicit @return annotation to suppress this message. 2025-07-18T07:38:44+00:00 [critical] Uncaught Error: Call to undefined method Symfony\Config\Framework\HtmlSanitizer\SanitizerConfig::allowLinkSchemes()

.. code-block:: php-standalone

Expand All @@ -819,16 +819,16 @@
(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()
Expand Down Expand Up @@ -913,21 +913,21 @@
->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)
;
};

Check failure on line 930 in html_sanitizer.rst

View workflow job for this annotation

GitHub Actions / Code Blocks

[Cache Warmup] 2025-07-18T07:38:48+00:00 [info] User Deprecated: Method "Symfony\Component\HttpKernel\Bundle\Bundle::build()" might add "void" as a native return type declaration in the future. Do the same in child class "Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle" now to avoid errors or add an explicit @return annotation to suppress this message. 2025-07-18T07:38:48+00:00 [critical] Uncaught Error: Call to undefined method Symfony\Config\Framework\HtmlSanitizer\SanitizerConfig::allowMediaSchemes()

.. code-block:: php-standalone

Expand All @@ -938,16 +938,16 @@
(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()
Expand Down
Loading