mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Regex modified to to not capture brackets
Modified the existing regex from th TLD onwards Credit to @gruber for the regex info https://gist.github.com/gruber/249502
This commit is contained in:
parent
2bf41f3d85
commit
54e172b129
1 changed files with 1 additions and 1 deletions
|
@ -107,7 +107,7 @@ class TextHelper extends AppHelper {
|
||||||
$this->_placeholders = array();
|
$this->_placeholders = array();
|
||||||
$options += array('escape' => true);
|
$options += array('escape' => true);
|
||||||
|
|
||||||
$pattern = '#(?<!href="|src="|">)((?:https?|ftp|nntp)://[\p{L}0-9.\-_:]+(?:[/?][^\s<]*)?)#ui';
|
$pattern = '#(?<!href="|src="|">)((?:https?|ftp|nntp)://[\p{L}0-9.\-_:]+(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:\'".,<>?«»“”‘’]))#i';
|
||||||
$text = preg_replace_callback(
|
$text = preg_replace_callback(
|
||||||
$pattern,
|
$pattern,
|
||||||
array(&$this, '_insertPlaceHolder'),
|
array(&$this, '_insertPlaceHolder'),
|
||||||
|
|
Loading…
Add table
Reference in a new issue