Spam.php is antispam for all forms
Spam.php is antispam for all forms Posted by Alexander Shatalov STOP SPAM script. Helps to prevent wrong posts on siteAlso there is 80Mb of black IP list data available.. PHP private function checkComment() { if (!$this->comment) return; $c = strtolower($this->comment); foreach ($this->spam['comment'] as $v) { if (substr_count($c, $v)) { $this->text = 'Spam word detected: '.htmlspecialchars($v); $this->is = 'comment'; return true; } } if (substr_count($c,'[url=') && substr_count($c,'[link=')) { $this->text = 'Spam link detected'; $this->is = 'comment'; return true; } } private function checkEnv() { $this->env['ua'] = strtolower($_SERVER['HTTP_USER_AGENT']); $this->env['ref'] = strtolower($_SERVER['HTTP_REFERER']); $this->env['host'] = strtolower(@$_SERVER['REMOTE_HOST']); $this->env['ip'] = self::getIP(); if ($_SESSION['HTTP_REFERER']) { $r = addslashes(urldecode($_SESSION['HTTP_REFERER'])); $r = str_replace( '%3A', ':', $r); if (preg_match('/\.google\.co(m|\.[a-z]{2})/', $r) && strstr($r,'leave a comment')) { $this->is = 'referer'; return true; } } if (strstr($this->env['ua'],'libwww-perl') || strstr($this->env['ua'],'iopus-') || preg_match('/^(nutch|larbin|jakarta|java)/',$this->env['ua'])) { $this->is = 'user_agent'; return true; } if ($this->env['host']) { foreach ($this->spam['remote_host'] as $v) { if (preg_match('/'.$v.'/', $this->env['host'])) { $this->is = 'remote_host'; return true; } } } foreach ($this->spam['ip'] as $v) { if (preg_match('/'.$v.'/', $this->env['ip'])) { $this->is = 'ip'; return true; } } } | |
Alexander Shatalov 23 ноября 2013 in 16:39 | Spammers should know this) but sure I will fight against them as always Shitty work for spammers.. and thanx to them, a lot of knowledge collected. |