Merge pull request #19 from Manko10/master
SpamBee: Little spam log message fixes
This commit is contained in:
commit
53930b39aa
2 changed files with 16 additions and 5 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
Version 1.2.4
|
||||||
|
* Fixed: Spam log entry for wrong Captcha answer
|
||||||
|
* Truncated Captcha answer in spam log if it is longer than 40 characters
|
||||||
|
|
||||||
Version 1.2.3
|
Version 1.2.3
|
||||||
* Fixed: If core spam plugin was not installed, the check for required fiels was rejecting trackbacks sometimes.
|
* Fixed: If core spam plugin was not installed, the check for required fiels was rejecting trackbacks sometimes.
|
||||||
* Fixed: Rejecting comments having entry title as body only works for most blogs having the blogtitle as title, too.
|
* Fixed: Rejecting comments having entry title as body only works for most blogs having the blogtitle as title, too.
|
||||||
|
|
|
@ -106,7 +106,7 @@ class serendipity_event_spamblock_bee extends serendipity_event
|
||||||
'php' => '4.1.0'
|
'php' => '4.1.0'
|
||||||
));
|
));
|
||||||
|
|
||||||
$propbag->add('version', '1.2.3');
|
$propbag->add('version', '1.2.4');
|
||||||
|
|
||||||
$propbag->add('event_hooks', array(
|
$propbag->add('event_hooks', array(
|
||||||
'frontend_comment' => true,
|
'frontend_comment' => true,
|
||||||
|
@ -376,8 +376,12 @@ class serendipity_event_spamblock_bee extends serendipity_event
|
||||||
if ("NORMAL" == $addData['type']) { // only supported for normal comments
|
if ("NORMAL" == $addData['type']) { // only supported for normal comments
|
||||||
|
|
||||||
// Check for Honey Pot:
|
// Check for Honey Pot:
|
||||||
if ($this->useHoneyPot && (!empty($serendipity['POST']['phone']) || $serendipity['POST']['phone']=='0') ) {
|
$phone = $serendipity['POST']['phone'];
|
||||||
$this->spamlog($eventData['id'], 'REJECTED', "BEE Honeypot [" . $serendipity['POST']['phone'] . "]", $addData);
|
if ($this->useHoneyPot && (!empty($phone) || $phone == '0') ) {
|
||||||
|
if (mb_strlen($phone) > 40) {
|
||||||
|
$phone = mb_substr($phone, 0, 40) . '…';
|
||||||
|
}
|
||||||
|
$this->spamlog($eventData['id'], 'REJECTED', "BEE Honeypot [" . $phone . "]", $addData);
|
||||||
$eventData = array('allow_comments' => false);
|
$eventData = array('allow_comments' => false);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -391,7 +395,7 @@ class serendipity_event_spamblock_bee extends serendipity_event
|
||||||
|
|
||||||
// If provided answer is longer than 1000 characters and RegExp matching is on,
|
// If provided answer is longer than 1000 characters and RegExp matching is on,
|
||||||
// reject comment for security reasons (minimize risk of ReDoS)
|
// reject comment for security reasons (minimize risk of ReDoS)
|
||||||
if ($this->useRegularExpressions && strlen($answer) > 1000) {
|
if ($this->useRegularExpressions && mb_strlen($answer) > 1000) {
|
||||||
$this->processComment($this->hiddenCaptchaHandle, $eventData, $addData, PLUGIN_EVENT_SPAMBLOCK_BEE_ERROR_HCAPTCHA, "BEE HiddenCaptcha [ Captcha input too long ]");
|
$this->processComment($this->hiddenCaptchaHandle, $eventData, $addData, PLUGIN_EVENT_SPAMBLOCK_BEE_ERROR_HCAPTCHA, "BEE HiddenCaptcha [ Captcha input too long ]");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -422,7 +426,10 @@ class serendipity_event_spamblock_bee extends serendipity_event
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$isCorrect) {
|
if (!$isCorrect) {
|
||||||
$this->processComment($this->hiddenCaptchaHandle, $eventData, $addData, PLUGIN_EVENT_SPAMBLOCK_BEE_ERROR_HCAPTCHA, "BEE HiddenCaptcha [ $correct != $answer ]");
|
if (mb_strlen($answer) > 40) {
|
||||||
|
$answer = mb_substr($answer, 0, 40) . '…';
|
||||||
|
}
|
||||||
|
$this->processComment($this->hiddenCaptchaHandle, $eventData, $addData, PLUGIN_EVENT_SPAMBLOCK_BEE_ERROR_HCAPTCHA, "BEE HiddenCaptcha [ $correctAnswer[answer] != $answer ]");
|
||||||
return $isCorrect;
|
return $isCorrect;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue