[wp-cvs] wordpress/wp-includes functions.php,1.203,1.204
Ernest MacDougal Campbell III
emc3 at users.sourceforge.net
Wed Nov 3 14:21:49 UTC 2004
Update of /cvsroot/cafelog/wordpress/wp-includes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17839/wp-includes
Modified Files:
functions.php
Log Message:
ANTI-SPAM: reject numerically encoded entities that fall in the normal ASCII range
Index: functions.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/functions.php,v
retrieving revision 1.203
retrieving revision 1.204
diff -C2 -d -r1.203 -r1.204
*** functions.php 2 Nov 2004 02:13:00 -0000 1.203
--- functions.php 3 Nov 2004 14:21:46 -0000 1.204
***************
*** 1657,1660 ****
--- 1657,1670 ----
}
+ // Useless numeric encoding is a pretty good spam indicator:
+ // Extract entities:
+ if (preg_match_all('/&#(\d+);/',$comment,$chars)) {
+ foreach ($chars[1] as $char) {
+ // If it's an encoded char in the normal ASCII set, reject
+ if ($char < 128)
+ return false;
+ }
+ }
+
$mod_keys = trim( get_settings('moderation_keys') );
if ('' == $mod_keys )
More information about the cvs
mailing list