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 - See also

Author:  blueyed: Daniel HAHLER.
Author:  fplanque: Francois PLANQUE.
Author:  vegarg: Vegar BERG GULDAL.
Copyright:  (c) 2009 - 2011 by the Quam Plures developers -
Copyright:  (c)2003-2009 by Francois PLANQUE - Parts of this file are copyright (c)2004-2005 by Daniel HAHLER - Parts of this file are copyright (c)2004 by Vegar BERG GULDAL - Parts of this file are copyright (c)2005 by The University of North Carolina at Charlotte as contributed by Jason Edgecombe
Filesource:  Source Code for this file
License:  GNU General Public License (GPL)
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


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']  )


Insert a new abuse string into DB


[ Top ]
antispam_delete  [line 94]

void antispam_delete( $string_ID  )

[ Top ]
antispam_update_source  [line 79]

void antispam_update_source( $aspm_string, $aspm_source  )


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


[ 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.

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 ]