[wp-cvs] wordpress/wp-includes functions.php,1.204,1.205

Ernest MacDougal Campbell III emc3 at users.sourceforge.net
Fri Nov 5 03:56:44 UTC 2004


Update of /cvsroot/cafelog/wordpress/wp-includes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6500/wp-includes

Modified Files:
	functions.php 
Log Message:
BUGFIX: prevent '#' chars in moderation_keys from breaking regex handling.

Index: functions.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/functions.php,v
retrieving revision 1.204
retrieving revision 1.205
diff -C2 -d -r1.204 -r1.205
*** functions.php	3 Nov 2004 14:21:46 -0000	1.204
--- functions.php	5 Nov 2004 03:56:40 -0000	1.205
***************
*** 1678,1682 ****
  		if (empty($word)) { continue; }
  
! 		$pattern = "#$word#i";
  		if ( preg_match($pattern, $author) ) return false;
  		if ( preg_match($pattern, $email) ) return false;
--- 1678,1686 ----
  		if (empty($word)) { continue; }
  
! 		// Do some escaping magic so that '#' chars in the 
! 		// spam words don't break things:
! 		$word = preg_replace('/(\\\\|#)/','\\\\$1',$word);
! 		
! 		$pattern = "#$word#i"; 
  		if ( preg_match($pattern, $author) ) return false;
  		if ( preg_match($pattern, $email) ) return false;




More information about the cvs mailing list