Repository navigation
Validating what a URL points to (adult content, scams, betting), not just its format #62305
Replies: 2 comments 3 replies
Not everyone would want to use AI for a variety of reasons. This functionality could be provided by other means. If Laravel was to force this particular implementation of this functionality upon its users, it should at least explicitly disclose this in the docs.
I sincerely hope, you don't burn tokens for all of that, which could be checked deterministically. If you do, it is at best inefficient. |
|
I am sceptical that a minimalistic 1st party validation that only checks the TLD will be adequate in any real use case. I doubt that there is any shortage of examples of adult sites that use |
Uh oh!
There was an error while loading. Please reload this page.
I really like Laravel's validation rules, especially
email:dns, which I use in every project. For URLs, though,urlandactive_urlonly tell us the link is well formed and resolves. They say nothing about what is on the other side.I ran into this in a startup directory I maintain. Users submit their product's website and an AI generates a report about it. I didn't want adult content, scams or betting sites showing up on my home page, and every one of those submissions was also costing me an AI call. Checking the URL before calling the AI cut that cost a lot.
So I built rowbird/laravel-safe-url:
It combines adult TLDs (.xxx, .porn, .adult, .sex), offline blocklists, Cloudflare's family DNS, Google Safe Browsing and optional page inspection, with caching and SSRF protection.
I know most of this belongs in a package, since it relies on external lists and services. But I'm curious: would a minimal first-party version make sense, for example a
url:adultoption that only checks the TLDs reserved for adult content and needs no external service?Feedback on the package is very welcome too.
All reactions