mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 19:38:26 +00:00
Fixes #3419, $text->autoLink does not preserve existing links
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5836 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
acdeadde01
commit
1704efa50a
1 changed files with 2 additions and 2 deletions
|
@ -106,10 +106,10 @@ class TextHelper extends AppHelper {
|
||||||
}
|
}
|
||||||
$options .= ')';
|
$options .= ')';
|
||||||
|
|
||||||
$text=preg_replace_callback('#((?:http|https|ftp|nntp)://[^ <]+)#', create_function('$matches',
|
$text = preg_replace_callback('#(?<!href="|">)((?:http|https|ftp|nntp)://[^ <]+)#i', create_function('$matches',
|
||||||
'$Html = new HtmlHelper(); $Html->tags = $Html->loadConfig(); return $Html->link($matches[0], $matches[0],' . $options . ');'), $text);
|
'$Html = new HtmlHelper(); $Html->tags = $Html->loadConfig(); return $Html->link($matches[0], $matches[0],' . $options . ');'), $text);
|
||||||
|
|
||||||
return preg_replace_callback('#(?<!http://|https://|ftp://|nntp://)(www\.[^\n\%\ <]+[^<\n\%\,\.\ <])#i',
|
return preg_replace_callback('#(?<!href="|">)(?<!http://|https://|ftp://|nntp://)(www\.[^\n\%\ <]+[^<\n\%\,\.\ <])#i',
|
||||||
create_function('$matches', '$Html = new HtmlHelper(); $Html->tags = $Html->loadConfig(); return $Html->link($matches[0], "http://" . low($matches[0]),' . $options . ');'), $text);
|
create_function('$matches', '$Html = new HtmlHelper(); $Html->tags = $Html->loadConfig(); return $Html->link($matches[0], "http://" . low($matches[0]),' . $options . ');'), $text);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue