Jump to content

Filter Links out of Comments


koolkat67

Recommended Posts

alright, last week I posted a link to my site where people can leave comments and some low-life decided to post links on that page.  Is there someway to filter out links?  I dont really want to use the htmlspecialchars() or the htmlentities() to simply disable them, I want to block them altogether.  Maybe some way to filter out "www" or something?

Link to comment
https://forums.phpfreaks.com/topic/45431-filter-links-out-of-comments/
Share on other sites

just do it like bbcode

$bbcode = array('www.', '.com', 'www', 'com'); 

$html = array('', '', '', '');

$output = preg_replace($bbcode, $html, $output);

 

please edit bold bits, and you might want to add more things in the bbcode array, like http://  .net  net.

i could go on all day

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.