Spam-X
[ class tree: Spam-X ] [ index: Spam-X ] [ all elements ]

Class: SLVbase

Source Location: /plugins/spamx/SLVbase.class.php

Class Overview


Sends posts to SLV (linksleeve.org) for examination


Author(s):

  • Dirk Haun dirk AT haun-online DOT de based on the works of Tom Willet (Spam-X) and Russ Jones (SLV)

Variables

Methods



Class Details

[line 28]
Sends posts to SLV (linksleeve.org) for examination



Tags:

author:  Dirk Haun dirk AT haun-online DOT de based on the works of Tom Willet (Spam-X) and Russ Jones (SLV)


[ Top ]


Class Variables

$_debug =  false

[line 30]


Type:   mixed


[ Top ]

$_verbose =  false

[line 32]


Type:   mixed


[ Top ]



Class Methods


constructor SLVbase [line 37]

SLVbase SLVbase( )

Constructor



[ Top ]

method CheckForSpam [line 53]

boolean CheckForSpam( string $post)

Check for spam links



Tags:

return:  

true = spam found, false = no spam

Note: Also returns 'false' in case of problems communicating with SLV. Error messages are logged in Geeklog's error.log



Parameters:

string   $post   post to check for spam

[ Top ]

method checkWhitelist [line 119]

void checkWhitelist( array &$links)

Check whitelist

Check against our whitelist of sites not to report to SLV. Note that URLs starting with $_CONF['site_url'] have already been removed earlier.




Tags:

return:  ($links is passed by reference and modified in place)


Parameters:

array   &$links   array of URLs from a post

[ Top ]

method getLinks [line 150]

array getLinks( string $comment)

Extract links

Extracts all the links from a post; expects HTML links, i.e. <a> tags




Tags:

return:  All the URLs in the post


Parameters:

string   $comment   The post to check

[ Top ]

method prepareLinks [line 185]

string prepareLinks( string $comment)

Extract only the links from the post

SLV has a problem with non-ASCII character sets, so we feed it the URLs only. We also remove all URLs containing our site's URL.

Since we don't know if the post is in HTML or plain ASCII, we run it through getLinks() twice.




Tags:

return:  All the URLs in the post, sep. by linefeeds


Parameters:

string   $comment   The post to check

[ Top ]


Documentation generated on Thu, 24 May 2012 02:08:55 -0400 by phpDocumentor 1.4.3