a dot (.) is a reserved character to mean "anything" - use a \ before it as follows:
if (preg_match('/(http|www|\.com|\.es|\.co\.uk|\.info|\.org)/i', request_var('message', '', true)))
\b means word boundary, so you might consider (or try) this, I have not tested it:
/(\b(http|www)\b)|(.(com|es|co.uk|info|org))/i
joad;10997148 wrote:Have been working on some PHP code and trying to implement the below code on a forum, and has generally worked okay when a poster is just posting their post only, BUT, when they're also quoting another users post within theirs, without apparently going against any of the coding below, it gives the error message as if someone has posted one of the below? Is it the
code that appears when quoting someone elses post ?
if (preg_match('/(http|www|.com|.es|.co.uk|.info|.org)/i', request_var('message', '', true)))
But,with the .com in the code, it's also picking up on the words command, competition etc - is there any way that it can just pick up on the .com - (only if it has the dot as the prefix)