Fix incorrect autolinking when urls end at HTML tags.

Fixes #3879
This commit is contained in:
mark_story 2013-06-15 22:01:29 -04:00
parent fe809cd85d
commit 111bfa43d4
2 changed files with 12 additions and 1 deletions

View file

@ -105,7 +105,7 @@ class TextHelper extends AppHelper {
$this->_placeholders = array();
$options += array('escape' => true);
$pattern = '#(?<!href="|src="|">)((?:https?|ftp|nntp)://[a-z0-9.\-:]+(?:[/?][^\s]*)?)#i';
$pattern = '#(?<!href="|src="|">)((?:https?|ftp|nntp)://[a-z0-9.\-:]+(?:[/?][^\s<]*)?)#i';
$text = preg_replace_callback(
$pattern,
array(&$this, '_insertPlaceHolder'),