phpDocumentor pond
[ class tree: pond ] [ index: pond ] [ all elements ]

Procedural File: _antispam.funcs.php

Source Location: /qp_inc/antispam/model/_antispam.funcs.php

Page Details

This file implements Antispam handling functions.

This file is part of the Quam Plures project - http://quamplures.net/. See also https://launchpad.net/quam-plures.

Author:  blueyed: Daniel HAHLER.
Author:  fplanque: Francois PLANQUE.
Author:  vegarg: Vegar BERG GULDAL.
Copyright:  (c) 2009 - 2011 by the Quam Plures developers - http://quamplures.net/
Copyright:  (c)2003-2009 by Francois PLANQUE - http://fplanque.net/. Parts of this file are copyright (c)2004-2005 by Daniel HAHLER - http://thequod.de/contact. Parts of this file are copyright (c)2004 by Vegar BERG GULDAL - http://funky-m.com/. Parts of this file are copyright (c)2005 by The University of North Carolina at Charlotte as contributed by Jason Edgecombe http://tst.uncc.edu/.
Filesource:  Source Code for this file
License:  GNU General Public License (GPL)
Functions
antispam_check  [line 121]

string antispam_check( $haystack  )

Check if a string contains abusive substrings

Note: Letting the database do the LIKE %% match is a little faster than doing in it PHP, not to mention the incredibly long overhead of preloading the list into PHP

Parameters:
   $haystack: 

API Tags:
Return:  blacklisted keyword found or false if no spam detected

Information Tags:
Todo:  dh> IMHO this method is too generic used! It gets used for:
  • comment author name
  • comment/message author email
  • comment content
  • message (email) content
  • validate_url
..and validates all this against the antispam blacklist! We should rather differentiate here more and make it pluggable!

[ Top ]
antispam_create  [line 47]

void antispam_create( $abuse_string, [ $aspm_source = 'local']  )

antispam_create(-)

Insert a new abuse string into DB

Parameters:
   $abuse_string: 
   $aspm_source: 


[ Top ]
antispam_delete  [line 94]

void antispam_delete( $string_ID  )
Parameters:
   $string_ID: 


[ Top ]
antispam_update_source  [line 79]

void antispam_update_source( $aspm_string, $aspm_source  )

antispam_update_source(-)

Note: We search by string because we sometimes don't know the ID (e-g when download already in list/cache)

Parameters:
   $aspm_string: 
   $aspm_source: 


[ Top ]
get_ban_domain  [line 155]

string|false get_ban_domain( string $url  )

Get the base domain that could be blacklisted from an URL.

We want to concentrate on the main domain and we want to prefix it with either . or // in order not to blacklist too large.

Parameters:
string   $url:  URL or domain

API Tags:
Return:  the pattern to match this domain in the blacklist; false if we could not extract the base domain
Usedby:  referer_ban_link()


[ Top ]