com web/bugs: - Simplify spam check and added "chaneljpoutlet" to the keywords list: include/functions.php
| From: | Felipe Pena | Date: | Thu, 10 May 2012 11:23:20 +0000 |
| Subject: | com web/bugs: - Simplify spam check and added "chaneljpoutlet" to the keywords list: include/functions.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-13505@lists.php.net to get a copy of this message | ||
Commit: d0727c2ae5934b7dabf8159f99926eeb0d94b98d
Author: Felipe Pena <felipensp@gmail.com> Thu, 10 May 2012 08:23:20 -0300
Parents: d358b33d19d8cb07f622c66ce074c63dbe1d1089
Branches: master
Link: http://git.php.net/?p=web/bugs.git;a=commitdiff;h=d0727c2ae5934b7dabf8159f99926eeb0d94b98d
Log:
- Simplify spam check and added "chaneljpoutlet" to the keywords list
Changed paths:
M include/functions.php
Diff:
diff --git a/include/functions.php b/include/functions.php
index 54b544b..1f9beda 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -259,12 +259,37 @@ function is_spam($string)
if (substr_count(strtolower($string), 'http://') > 5) {
return true;
}
- if
(preg_match("/(asian)|(spy)|(bdsm)|(massage)|(mortage)|(sex)(?<!OutOfBoundsEx(?=ception))|(11nong)|(oxycontin)|(distance-education)|(sismatech)|(justiceplan)|(prednisolone)|(baclofen)|(diflucan)|(unbra.se)|(objectis)|(angosso)|(colchicine)|(zovirax)|(korsbest)|(coachbags)/i",
$string)) {
- return true;
- }
- if (preg_match("~/Members/~", $string)) {
+
+ $keywords = array(
+ 'asian',
+ 'spy',
+ 'bdsm',
+ 'massage',
+ 'mortage',
+ 'sex(?<!OutOfBoundsEx(?=ception))',
+ '11nong',
+ 'oxycontin',
+ 'distance-education',
+ 'sismatech',
+ 'justiceplan',
+ 'prednisolone',
+ 'baclofen',
+ 'diflucan',
+ 'unbra.se',
+ 'objectis',
+ 'angosso',
+ 'colchicine',
+ 'zovirax',
+ 'korsbest',
+ 'coachbags',
+ 'chaneljpoutlet',
+ '\/Members\/',
+ );
+
+ if (preg_match('/('. implode('|', $keywords) . ')/i', $string)) {
return true;
}
+
return false;
}