On 07/03/13 21:03, anubhav agarwal wrote:
Hey Chris
I was exploring SpamBlaklist Extension. I have some doubts hope you could clear them.
Is there any place I can get documentation of Class SpamBlacklist in the file SpamBlacklist_body.php. ?
In function filter what does the following variables represent ?
$title
Title object (includes/Title.php) This is the page where it tried to save.
$text
Text being saved in the page/section
$section
Name of the section or ''
$editpage
EditPage object if EditFilterMerged was called, null otherwise
$out
A ParserOutput class (actually, this variable name was a bad choice, it looks like a OutputPage), see includes/parser/ParserOutput.php
I have understood the following things from the code, please correct me if I am wrong. It extracts the edited text, and parse it to find the links.
Actually, it uses the fact that the parser will have processed the links, so in most cases just obtains that information.
It then replaces the links which match the whitelist regex,
This doesn't make sense as you explain it. It builds a list of links, and replaces whitelisted ones with '', ie. removes whitelisted links from the list.
and then checks if there are some links that match the blacklist regex.
Yes
If the check is greater you return the content matched.
Right, $check will be non-0 if the links matched the blacklist.
it already enters in the debuglog if it finds a match
Yes, but that is a private log. Bug 1542 talks about making that accesible in the wiki.
I guess the bug aims at creating a sql table. I was thinking of the following fields to log. Title, Text, User, URLs, IP. I don't understand why you denied it.
Because we don't like to publish the IPs *in the wiki*.
I think the approach should be to log matches using abusefilter extension if that one is loaded. I concur that it seems too hard to begin with.