Just Launched: You can now import projects and releases from Google Code onto SourceForge
We are excited to release new functionality to enable a 1-click import from Google Code onto the Allura platform on SourceForge. You can import tickets, wikis, source, releases, and more with a few simple steps. Read More
From: SquirrelMail List Act <sm@ro...> - 2010-01-03 04:05:20
I found an issue w/ the latest version of spam buttons - and have a simple
code fix below. Not sure where to submit, hopefully this is the right
- When using the (not)spam headers options like below -
$sb_spam_header_name = 'X-SpamHalter';
$sb_spam_header_value = '/^SpamHalter detected SPAM/i';
if the specified header does NOT exist in a message, the PHP error
"Undefined offset: 1" appears at the bottom of the message (indicating
error in lines 606 and 627 of buttons.php)...
This appears to be due to the fact that the code doesn't check if the
$headers variable contains anything before calling prer_match. On my
system, messages between local users aren't checked for spam and/or tagged
w/ a header field, thus I was getting the error for internal messages but
not ones coming externally.
If you change the code and add "count($header) > 0 && " at the beginning
of each if statement in lines 606 & 627, then if the Spam / Not-Spam
header doesn't exist in a message the function just returns false (i.e. no
match) and all is well (no errors) -
i.e. for line 606 of buttons.php, change:
if (preg_match($sb_spam_header_value, trim($header)))
if (count($header) > 0 && preg_match($sb_spam_header_value,
and for line 627 of buttons.php, change:
if (preg_match($sb_not_spam_header_value, trim($header)))
if (count($header) > 0 && preg_match($sb_not_spam_header_value,
This email was sent using SquirrelMail.
"Webmail for nuts!"