jaybizzle/safeurl
jaybizzle/safeurl is a lightweight PHP package for validating and sanitizing URLs before use, helping prevent open redirects, SSRF, and malicious links by checking schemes, hosts, and allowed domains. Useful for safe redirects and URL handling.
?redirect_to=, marketing/campaign redirectors, OAuth/SSO return URLs, webhook and callback URL registration, email-link builders, deep-link handlers, and "trusted partner" outbound links. If a feature ships a user-controlled Location: header or an outbound hop, this package is relevant.^13.0 Laravel support, which is a forward-compatibility signal rather than a feature. It de-risks the Laravel major-upgrade line item: teams planning a Laravel 13 migration do not need to budget removal, fork, or replacement work for this dependency, and the maintainer is tracking framework releases promptly after a major.Consider it when:
filter_var() checks — consistency matters more than sophistication here.^13.0, so adoption now avoids a pin-and-patch cycle during the upgrade window.Look elsewhere when:
Adoption criteria: it should be a leaf dependency, no service-provider magic required in hot paths, covered by your existing redirect tests, and removable in an afternoon. It meets that bar.
For executives (one line): A small, actively maintained library that closes the open-redirect class of vulnerability across every feature that accepts a user-supplied link — cheaper and safer than building it ourselves, and its new Laravel 13 support means it will not block our next framework upgrade.
For engineering:
filter_var/regex checks with a single reviewed implementation, which is the actual win: consistent behavior and one place to reason about policy.^13.0 Laravel support, no API changes, no deprecations, no breaking changes. Low-risk, non-urgent. Fold it into the next routine dependency bump; no dedicated migration needed.How can I help you explore Laravel packages today?