On Wed, Jun 16, 2010 at 08:00:09PM +0100, ed neville wrote:
Hi All,
Recently I had a thought about trackback.php to attempt to discard spam
so I've made this minor alteration. Could be it reviewed and perhaps
included? Thanks
...
Index: trackback.php
===================================================================
@@ -43,17 +43,33 @@
$tburl = strval( $_POST['url'] );
$tbname = strval( @$_POST['blog_name'] );
$tbarticle = strval( $_REQUEST['article'] );
+$tbip = strval( $_SERVER['REMOTE_ADDR'] );
$title = Title::newFromText($tbarticle);
if( !$title || !$title->exists() )
XMLerror( "Specified article does not exist." );
+
+if( $wgUseTrackbacksRBL==true && substr_count( $tbip, ":" ) == 0
&&
substr_count( $tbip, "." ) > 0 ) {
+
+ $rbl_list = array( "zen.spamhaus.org", "dnsbl.njabl.org",
"dnsbl.sorbs.net", "bl.spamcop.net" );
+
+ foreach( $rbl_list as $rbl_site ) {
+ $ip_arr = array_reverse( explode( '.', $tbip ) );
+ $lookup = implode( '.', $ip_arr ) . '.' . $rbl_site;
+ if( $lookup != gethostbyname( $lookup ) ) {
+ XMLerror( $tbip . " is listed in " . $rbl_site
);
+ }
+ }
+}
+
Any chance anyone can give their thoughts on the above?
--
Best regards,
Ed
http://www.s5h.net/