[wp-cvs] wordpress/wp-includes functions.php,1.101.4.5,1.101.4.6
Ryan Boren
rboren at users.sourceforge.net
Sun Nov 28 05:26:22 UTC 2004
Update of /cvsroot/cafelog/wordpress/wp-includes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32378/wp-includes
Modified Files:
Tag: WordPress-Ver-1_2-Branch
functions.php
Log Message:
Use preg_quote() to make spam words regex safe.
Index: functions.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/functions.php,v
retrieving revision 1.101.4.5
retrieving revision 1.101.4.6
diff -C2 -d -r1.101.4.5 -r1.101.4.6
*** functions.php 27 Nov 2004 22:54:52 -0000 1.101.4.5
--- functions.php 28 Nov 2004 05:26:20 -0000 1.101.4.6
***************
*** 1345,1348 ****
--- 1345,1353 ----
foreach ($words as $word) {
$word = trim($word);
+
+ // Do some escaping magic so that '#' chars in the
+ // spam words don't break things:
+ $word = preg_quote($word, '#');
+
$pattern = "#$word#i";
if ( preg_match($pattern, $author) ) return false;
More information about the cvs
mailing list