bbAntiSpam: Discuss how to stop web spam

The forum is retired.

bbAntiSpam Forum Index - Links Rejector - Blocking <a> posts

Author Message
DickS



Joined: 08 Aug 2006
Posts: 13

Posted: Mon Sep 11, 2006 8:08 am    Post subject: Blocking <a> posts  

Example: www.pamela-systems.com/forum/viewtopic.php?p=3277#3277

How to block these posts as they seem to get through? They are useless of course, but a robot is adding this junk to the forum. Would be nice to block this too.
admin
Site Admin


Joined: 18 Apr 2006
Posts: 805
Location: Saint-Petersburg, Russia

Posted: Tue Sep 12, 2006 4:22 am    Post subject:  

Strange... It should be blocked. It seems I need the source code of the posting. Under Admin, click "edit" to get it. Please PM me with the user name, the posting subject and its source code. Thanks.
admin
Site Admin


Joined: 18 Apr 2006
Posts: 805
Location: Saint-Petersburg, Russia

Posted: Wed Sep 13, 2006 4:28 am    Post subject:  

The posting was dummy, without links:
Quote:
The typical American family has a love and <a>Debt Consolidation</a> hate relationship with debt. Everyone loves <a>California debt consolidation</a> spending <a>Debt consolidation Faq</a> money and no one likes <a>credit card debt consolidation loan</a> paying it back. That <a>Debt Relief</a> leads to a nasty situation where ...

The proposed solution from DickS is:
Quote:
I added */a* to the word censor list and now it is blocked

Wonderful hint!
DickS



Joined: 08 Aug 2006
Posts: 13

Posted: Sat Sep 23, 2006 7:35 am    Post subject:  

OK, the word block somehow does not provide 100% protection. I added following code to functions_bbas.php:

Find:

Quote:

if ($check_for_phone) {
preg_match_all("/[^0-0](\d\d\d-\d\d-?\d\d)/", $text, $phones);
if (count ($phones[0])) {
$ret = array_merge ($ret, $phones[0]);
}
}



Add after:

Quote:
//added to block www domain names and posts containing "/a"
if (! (FALSE === strpos(strtolower($text), 'www'))) {
$ret[] = 'Guest posts can not contain "www".';
}
if (! (FALSE === strpos(strtolower($text), '/a'))) {
$ret[] = 'Guest posts can not contain HTML tags.';
}


Cheers!

DickS
DickS



Joined: 08 Aug 2006
Posts: 13

Posted: Mon Jan 01, 2007 11:34 am    Post subject:  

In new Links Rejector I noticed that posts with <a> are not blocked. Example:

Quote:
User name: Thiet Ke Noi That, subject: cong ty du lich viet nam

reinduce braconid faradize lopstick rebought <a>Thiet ke noi that</a>


The above should not be neccessary with new Links Rejector as this now contains:

Quote:
//
// Extract explicit links (<a href="...">...</a>)
//
preg_match_all('/href\s*=\s*["\']([^"\']+)["\']/', $text, $explicit_links);
if (count ($explicit_links[1])) {
$ret = array_merge ($ret, $explicit_links[1]);
}


For some reason it does not work 100%. I did not have */a* in word censor list anymore when above string was posted as guest. Strange was that links rejector blocked it but still the post was submitted to forum.

Any suggestions what needs to be changed?

DickS
admin
Site Admin


Joined: 18 Apr 2006
Posts: 805
Location: Saint-Petersburg, Russia

Posted: Tue Jan 02, 2007 6:45 am    Post subject:  

Thanks for reporting. Indeed, this code doesn't work. I've traced the reason why it is so. Links Rejector gets a bit mangled text from phpBB. To be workarounded in the next update.

Quote:
Any suggestions what needs to be changed?

Right now, please repeat your changes described in your posting of "23 Sep 2006".

Quote:
Strange was that links rejector blocked it but still the post was submitted to forum.

Probably the rejected message contained someting more, and that more had links.
DickS



Joined: 08 Aug 2006
Posts: 13

Posted: Tue Jan 02, 2007 12:27 pm    Post subject:  

OK, I added */a* to word censor list for the meantime Smile.

Thanks!

DickS

Ok.