Skip to content

Commit

Permalink
change preg_replace so that auto url replacement works with urls encl…
Browse files Browse the repository at this point in the history
…osed in ( ), see bug #462

git-svn-id: https://svn.php.net/repository/pear/packages/HTML_BBCodeParser/trunk@149305 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information
Stijn de Reede committed Jan 20, 2004
1 parent 1fe9df6 commit 9330d73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion BBCodeParser/Filter/Links.php
Expand Up @@ -71,7 +71,7 @@ function _preparse()
$c = $options['close'];
$oe = $options['open_esc'];
$ce = $options['close_esc'];
$pattern = array( "!(^|\s)((((http(s?)|ftp)://)|www)[-a-z0-9.]+\.[a-z]{2,4}\S*)!i",
$pattern = array( "!(^|\s|\()((((http(s?)|ftp)://)|www)[-a-z0-9.]+\.[a-z]{2,4}[^\s()]*)!i",
"!".$oe."url(".$ce."|\s.*".$ce.")(.*)".$oe."/url".$ce."!i");
$replace = array( "\\1".$o."url".$c."\\2".$o."/url".$c,
$o."url=\\2\\1\\2".$o."/url".$c);
Expand Down

0 comments on commit 9330d73

Please sign in to comment.