AndyB Posted September 8, 2006 Share Posted September 8, 2006 I'm running the comment spam catcher that's exactly as shown at http://www.imarc.net/blog/61/stopping_blog_comment_spam_with_php/Can't post the code here because the IPS rejects the post :oWhen I have a plain text string without any of the 'common spam' words, it works. As soon as I include a common spam word, it throws a Warning: Unknown modifier '\' in c:\phpdev\www\ ... on line 33 (which is the line in the phpBB links section):[code]$total_matches += 5 * preg_match_all($regex, $text, $trash);[/code]Anyone care to point out the corrective action needed, or point me to an effective alternative? Quote Link to comment Share on other sites More sharing options...
effigy Posted September 8, 2006 Share Posted September 8, 2006 Since[tt] / [/tt] is the delimiter, any[tt] /[/tt]'s in the pattern must be escaped: [tt]/[\s*[b]/[/b]\s*url\s*]/i[/tt]. Even with that escaped, I still don't agree with the pattern: the [tt][ ][/tt]'s are not escaped, therefore specifying a character class instead of actual braces. All they should need for counting the links is [tt]/ \ [ url =/ i[/tt] at the bare minimum. (Spaces were added so this forum would not interpret it as bbcode.) Quote Link to comment Share on other sites More sharing options...
AndyB Posted September 8, 2006 Author Share Posted September 8, 2006 Thanks, effigy. That's taken care of the error. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.