php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37310 Note system: Important spam check missing
Submitted: 2006-05-04 14:55 UTC Modified: 2006-05-04 17:01 UTC
From: dave@php.net Assigned:
Status: Closed Package: Website problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: dave@php.net
New email:
PHP Version: OS:

 

 [2006-05-04 14:55 UTC] dave@php.net
Description:
------------
The most important IP address, $ip, is not processed by the is_spammer() function.

Two IPs are currently checked:

- $_SERVER['REMOTE_ADDR']: This is almost always a mirror, but sometimes a user so it is still needed.

- $redirip: This is supplied by the mirror (or potentially a user) and contains the X-Forwarded-For or Via IP.

However, mirrors also provide $ip, which is the direct $_SERVER['REMOTE_ADDR'] from that mirror. This needs to be checked for spammers too!

Here's a patch:

diff -u -r1.51 user-note.php
--- user-note.php       22 Mar 2006 19:20:20 -0000      1.51
+++ user-note.php       4 May 2006 14:51:32 -0000
@@ -50,7 +50,7 @@
   die("missing some parameters.");
 
 // check if the IP is blacklisted
-if (is_spammer($_SERVER['REMOTE_ADDR']) || is_spammer($redirip)) {
+if (is_spammer($_SERVER['REMOTE_ADDR']) || is_spammer($ip) || is_spammer($redirip)) {
     die ('[SPAMMER]');
 }


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-05-04 17:01 UTC] nlopess@php.net
nice catch Dave!
Patch applied, thanks.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Tue Jun 16 19:00:01 2026 UTC