Someone just made a group on my site which has a description with
. The thing is that I already do this to the description text:
//Convert all urls to links
$group_description = preg_replace('#([\s|^])(www)#i', '$1http://$2', $group_description);
$pattern = '#((http|https|ftp|telnet|news|gopher|file|wais):\/\/[^\s]+)#i';
$replacement = '<a href="$1" target="_blank">$1</a>';
$group_description = preg_replace($pattern, $replacement, $group_description);
$group_description = str_replace("\'" , "'", $group_description );
$group_description = nl2br($group_description);
/* Convert all E-mail matches to appropriate HTML links */
$pattern = '#([0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.';
$pattern .= '[a-wyz][a-z](fo|g|l|m|mes|o|op|pa|ro|seum|t|u|v|z)?)#i';
$replacement = '<a href="mailto:\\1">\\1</a>';
$group_description = preg_replace($pattern, $replacement, $group_description);
You can see this happening here.
You see it says there
Welcome to Join
.
Why didn't it become a <br />
tag?
This is probably important, here is how I put this text into the db in the first place:
$group_description = mysql_real_escape_string($_POST['group_description']);
// And then insert the $group_description into the db without doing any more operations on it.
Any idea why I am still getting the
?