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

Conversation

OskarStark
Copy link
Contributor

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

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
@OskarStark OskarStark requested a review from javiereguiluz July 18, 2025 07:36
@OskarStark OskarStark added the bug label Jul 18, 2025
@carsonbot carsonbot added this to the 6.4 milestone Jul 18, 2025
@carsonbot carsonbot changed the title Fix HTML Sanitizer method names in documentation [HtmlSanitizer] Fix HTML Sanitizer method names in documentation Jul 18, 2025
@OskarStark OskarStark changed the title [HtmlSanitizer] Fix HTML Sanitizer method names in documentation [HtmlSanitizer] Fix method names Jul 18, 2025
->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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants