cvs: pearweb /public_html/trackback trackback.php

From: Date: Mon, 23 May 2005 21:09:51 +0000
Subject: cvs: pearweb /public_html/trackback trackback.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-cvs+get-32087@lists.php.net to get a copy of this message
toby Mon May 23 17:09:51 2005 EDT Modified files: /pearweb/public_html/trackback trackback.php Log: * Migration to Services_Trackback 0.5.0. http://cvs.php.net/diff.php/pearweb/public_html/trackback/trackback.php?r1=1.11&r2=1.12&ty=u Index: pearweb/public_html/trackback/trackback.php diff -u pearweb/public_html/trackback/trackback.php:1.11 pearweb/public_html/trackback/trackback.php:1.12 --- pearweb/public_html/trackback/trackback.php:1.11 Tue Apr 12 00:52:30 2005 +++ pearweb/public_html/trackback/trackback.php Mon May 23 17:09:51 2005 @@ -17,7 +17,7 @@ | Authors: Tobias Schlitt <toby@php.net> | | | +----------------------------------------------------------------------+ - $Id: trackback.php,v 1.11 2005/04/12 04:52:30 toby Exp $ + $Id: trackback.php,v 1.12 2005/05/23 21:09:51 toby Exp $ */ require_once 'Damblan/Trackback.php'; require_once 'Damblan/Mailer.php'; @@ -25,6 +25,8 @@ $site = new Damblan_URL; +error_reporting(E_ALL); + $params = array('action' => '', 'id' => ''); $site->getElements($params); @@ -57,31 +59,36 @@ $trackback = new Damblan_Trackback(array( 'id' => $id, 'timestamp' => time(), - 'ip' => $_SERVER['REMOTE_ADDR'], )); $res = $trackback->receive(); if (PEAR::isError($res)) { + echo $res->getMessage(); echo Services_Trackback::getResponseError('The data you submited was invalid, please recheck.', 1); exit; } + +/* + * hackish help - replaced by Services_Trackback::checkSpam() + if (strstr(strtolower($trackback->title), "poker")) { echo Services_Trackback::getResponseError("Sorry, your post seems to be spam!", 1); exit; } + + * + */ -// Check for possible spam and stop it. -$res = $trackback->checkRepost($dbh); -if (PEAR::isError($res)) { - echo Services_Trackback::getResponseError($res->getMessage(), 1); - exit; -} +// Check for possible spam +$trackback->createSpamCheck('Wordlist'); +$trackback->createSpamCheck('DNSBL'); +$trackback->createSpamCheck('SURBL'); + -// Check blacklists $res = $trackback->checkSpam(); -if (PEAR::isError($res)) { - echo Services_Trackback::getResponseError($res->getMessage(), 1); +if ($res) { + echo Services_Trackback::getResponseError('Your trackback seems to be spam. If it is not, please contact the webmaster of this site.', 1); exit; }

« previous php.pear.cvs (#32087) next »