diff options
author | zotlabs <mike@macgirvin.com> | 2017-11-09 21:26:18 -0800 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2017-11-11 21:42:49 +0100 |
commit | f7e3d0dbf6a763557d3431c6d12a6dde1be5648b (patch) | |
tree | 16b6425d9b667cfb2ec9c3163c7907e631a29acc /include/bbcode.php | |
parent | e2eb36ded6ae61b949bb5948145c007b1522faf9 (diff) | |
download | volse-hubzilla-f7e3d0dbf6a763557d3431c6d12a6dde1be5648b.tar.gz volse-hubzilla-f7e3d0dbf6a763557d3431c6d12a6dde1be5648b.tar.bz2 volse-hubzilla-f7e3d0dbf6a763557d3431c6d12a6dde1be5648b.zip |
hubzilla issue #901 - unicode characters in urls tripping up url regexes - these regexes have been modified to accept unicode "letters" which may preclude emojis and control sequences and symbols in url links; but should suffice for most legal URLs containing language context "text" glyphs.
Diffstat (limited to 'include/bbcode.php')
-rw-r--r-- | include/bbcode.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/bbcode.php b/include/bbcode.php index 9a2a6eb9b..050ab2d29 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -838,13 +838,13 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $cache = false) // Perform URL Search - $urlchars = '[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,\@\(\)]'; + $urlchars = '[a-zA-Z0-9\pL\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,\@\(\)]'; if (strpos($Text,'http') !== false) { if($tryoembed) { - $Text = preg_replace_callback("/([^\]\='".'"'."\/]|^|\#\^)(https?\:\/\/$urlchars+)/ism", 'tryoembed', $Text); + $Text = preg_replace_callback("/([^\]\='".'"'."\/]|^|\#\^)(https?\:\/\/$urlchars+)/ismu", 'tryoembed', $Text); } - $Text = preg_replace("/([^\]\='".'"'."\/]|^|\#\^)(https?\:\/\/$urlchars+)/ism", '$1<a href="$2" target="_blank" rel="nofollow noopener">$2</a>', $Text); + $Text = preg_replace("/([^\]\='".'"'."\/]|^|\#\^)(https?\:\/\/$urlchars+)/ismu", '$1<a href="$2" target="_blank" rel="nofollow noopener">$2</a>', $Text); } if (strpos($Text,'[/share]') !== false) { |