Code: Select all
$suppressq = "SELECT count(1)
FROM $serendipity[dbPrefix]suppress
WHERE ip = '$_SERVER[REMOTE_ADDR]'
AND scheme = '$url_parts[scheme]'
AND port = '$url_parts[port]'
AND host = '$url_parts[host]'
AND path = '$url_parts[path]'
AND query = '$url_parts[query]'
AND last > now() - $interval";
Code: Select all
$count = serendipity_db_query($suppressq, true);
if ($count[0] == 0) {
serendipity_db_query($suppressu);
return;
}
If a referring url has been seen in the past $interval seconds then log it. That confuses the heck out of me. Isn't that completely reversed? I don't really see the point of the supression table to begin with, but if you are going to have it, shouldn't you be discarding the referrers that are seen in the past $interval seconds and not the other way around?
I think someone may have overloaded this logic checking for 0 to insert the url the first time it is seen, but once the url is in the table this logic is backwards. Or perhaps I am misunderstanding the point of this code. I have commented out the whole mess on my server now and it is working just fine.