Is it possible to search for and remove URLs from a string in PHP. Talking about the actual text here not the HTML. Example to remove:
mywebsite.com
http://mywebsite.org
www.mywebsite.co.uk
www.my-web-site.net
sub.mywebsite.edu
etc
My issue is users submitting a description field and using it promote their own URLs. I’m not sure if its possible without generating too many false positives. I’ve thought about detecting the http:// or www. but that doesn’t stop links like mywebsite.com
You could try something that looks for .TLD, where TLD is any existing top-level domain, but that may result in too many false positives.
Would it be possible to implement a system where posts containing questionable content need moderation to be posted, but others are posted right away? I’m assuming it’s a firm business requirement to disallow this type of content.
Personally, I would tend to just prevent any hyperlinking, and leave it at that. But, it’s not my app.