Pixelpost

Authentic Photoblog Flavour


Go Back   Pixelpost Forum > DEVELOPMENT > Hacks and Modifications

Post Reply
 
Thread Tools
  #1  
Old 04-10-2006, 06:33 PM
kiroh Offline
forum loafer
 
Join Date: Apr 2006
Location: Ontario, Canada
Posts: 2
Version 1.4.3 spam hack - comments greatly appreciated

I'm trying out something... I've taken the idea from no-refer-spam, and applied it to index.php. I'm not sure how effective this will be, or if it's too inefficient - I'm not a PHP coder by any means...

In the "Save Comments" section, where the existing spam check code is, I moved the initial set statements for $parent_id, $name, $message, $url, $parent_name and $email so that they all appear after "$email_flag=0;".

Then, all I did was add the following:
Code:
	// spam list
	$spams = array (
		"spamkeyword1",
		"spamkeyword2",
	);
	
	foreach ($spams as $site) {
    		if (eregi($site,$parent_id) || eregi($site,$message) || eregi($site,$name) || eregi($site,$url) || eregi($site,$parent_name) || eregi($site,$email)){  die("SPAM Stopped: reason - $site");}
   	}
After this whatever checks there were already are done. Does anyone see anything wrong with doing it this way (aside from the fact that this has the potential to block legit posts)?
Reply With Quote
  #2  
Old 04-10-2006, 06:45 PM
Connie
Guest
 
Posts: n/a
the problem is that

- this should not be done in index.php but in addon
- that you did in 1.4.3
- that block lists like this exist in 1.5.1 BETA already

;=)

but the main problem is that blocklist should NEVER be written into the main code because of many reasons
Reply With Quote
  #3  
Old 04-10-2006, 06:50 PM
kiroh Offline
forum loafer
 
Join Date: Apr 2006
Location: Ontario, Canada
Posts: 2
Thanks for the comments! I'm just waiting for RC1 before upgrading, so that I only have to upgrade once

I just figured that this would be a quick fix until then, and wanted to make sure I'm not doing anything show-stopping stupid.
Reply With Quote
Post Reply


Thread Tools




All times are GMT. The time now is 02:52 PM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. | Style Design: d3 designs