-
Notifications
You must be signed in to change notification settings - Fork 350
feat: Add option for safe iframe hosts using array lookup #423
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
Conversation
9b66bca to
d2d87dd
Compare
| // check if the host is in a whitelist for safe iframe hosts | ||
| if ($safeHosts !== null && !isset($safeHosts[$uri->host])) { | ||
| return false; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You know what, I was wrong, disjunction actually seems right 🤣 Because it's a whitelist. So you can whitelist some urls with regex and also whitelist some hosts with safe host...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem. I changed it back. Thanks.
d2d87dd to
93ec6fd
Compare
* Added new option `URI.SafeIframeHosts` to use an array lookup with whitelisted hosts in conjunction to `URI.SafeIframeRegexp`.
# [4.19.0](v4.18.0...v4.19.0) (2025-10-17) ### Bug Fixes * add warning for misleading option ([#433](#433)) ([b21a591](b21a591)) * catastrophic backtracking in Core.AggressivelyFixLt ([#440](#440)) ([418eeb7](418eeb7)) * Deprecated: preg_replace(): Passing null to parameter [#3](#3) ($subject) o… ([#421](#421)) ([5d154a2](5d154a2)) * non-substantive typos ([#434](#434)) ([c2bc354](c2bc354)) ### Features * Add CSS direction support ([#429](#429)) ([63e631e](63e631e)) * Add option for safe iframe hosts using array lookup ([#423](#423)) ([b5cbf0c](b5cbf0c)) * Allow more image widths by default ([#430](#430)) ([00a0748](00a0748)) * Define option URI.AllowedSymbols ([#447](#447)) ([77ebd08](77ebd08)) * PHP 8.4 support ([#441](#441)) ([ff005f6](ff005f6)) * Support PHP 8.5 versions ([#453](#453)) ([1eb05d9](1eb05d9))
|
🎉 This PR is included in version 4.19.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Hi,
First of all, thank you for this awesome library.
I would like to know if you would consider adding a new option to use a list of "safe" iframe hosts in addition to SafeIframeRegExp.
I’m also starting to include Docker files to make it easier to bootstrap the development environment. I can remove them if needed.
Thank you