Reputation: 747
Is it possibble to remove links submitted in a form? ...this is what I currently have:
$forbidden = array('<[\w.]+@[\w.]+>', '<\w{3,6}:(?:(?://)|(?:\\\\))[^\s]+>', '#<.*?>([^>]*)</a>#i');
$matches = array('****', '****', '****');
$post = preg_replace($forbidden, $matches, $post);
This changes:
1) http://somesite.com to ****
2) [email protected] to ****
3) <a href="http://somesite.com">im spam</a> to <a href="****">im spam</a>
The first two are great but the third I really want the html code removed also ...
p.s: I also have a captcha in place but I want to be very strict on what can and can't be posted.
Upvotes: 1
Views: 209