aboutsummaryrefslogtreecommitdiffstats
path: root/include/markdown.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-11-09 21:26:18 -0800
committerzotlabs <mike@macgirvin.com>2017-11-09 21:26:18 -0800
commit9b19e40a74a4a5d641015c04c1765d4bd4502bd1 (patch)
tree2352619895cfdad2609f9dfaefbe3ad657e9acd9 /include/markdown.php
parent766a7fb1b46a506e92d62ed0b76e0e0e3e6958a5 (diff)
downloadvolse-hubzilla-9b19e40a74a4a5d641015c04c1765d4bd4502bd1.tar.gz
volse-hubzilla-9b19e40a74a4a5d641015c04c1765d4bd4502bd1.tar.bz2
volse-hubzilla-9b19e40a74a4a5d641015c04c1765d4bd4502bd1.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/markdown.php')
-rw-r--r--include/markdown.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/markdown.php b/include/markdown.php
index 865727b20..f398d279e 100644
--- a/include/markdown.php
+++ b/include/markdown.php
@@ -75,10 +75,10 @@ function markdown_to_bb($s, $use_zrl = false, $options = []) {
// Convert everything that looks like a link to a link
if($use_zrl) {
$s = str_replace(['[img', '/img]'], ['[zmg', '/zmg]'], $s);
- $s = preg_replace("/([^\]\=]|^)(https?\:\/\/)([a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,\@\(\)]+)/ism", '$1[zrl=$2$3]$2$3[/zrl]',$s);
+ $s = preg_replace("/([^\]\=]|^)(https?\:\/\/)([a-zA-Z0-9\pL\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,\@\(\)]+)/ismu", '$1[zrl=$2$3]$2$3[/zrl]',$s);
}
else {
- $s = preg_replace("/([^\]\=]|^)(https?\:\/\/)([a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,\@\(\)]+)/ism", '$1[url=$2$3]$2$3[/url]',$s);
+ $s = preg_replace("/([^\]\=]|^)(https?\:\/\/)([a-zA-Z0-9\pL\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,\@\(\)]+)/ismu", '$1[url=$2$3]$2$3[/url]',$s);
}
// remove duplicate adjacent code tags