From e346aa7560b93d1e5a331fa4ad9b16c70fe83ef7 Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 8 Feb 2014 12:08:07 -0800 Subject: that's better --- include/items.php | 2 ++ mod/item.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/items.php b/include/items.php index 88b258604..efc2322d5 100755 --- a/include/items.php +++ b/include/items.php @@ -159,6 +159,8 @@ function red_zrl_callback($matches) { if($r) $zrl = true; } + if($matches[1] === '#^') + $matches[1] = ''; if($zrl) return $matches[1] . '#^[zrl=' . $matches[2] . ']' . $matches[2] . '[/zrl]'; return $matches[1] . '#^[url=' . $matches[2] . ']' . $matches[2] . '[/url]'; diff --git a/mod/item.php b/mod/item.php index e8a58fe76..19d771832 100644 --- a/mod/item.php +++ b/mod/item.php @@ -431,7 +431,7 @@ function item_post(&$a) { $body = preg_replace('/\[([uz])rl(.*?)\](.*?)(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\@\_\~\#\%\$\!\+\,]+)(.*?)\[\/([uz])rl\]/ism','[$1rl$2]$3"$4"$5[/$6rl]',$body); - $body = preg_replace_callback("/([^\^\]\='".'"'."]|^)(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\@\_\~\#\%\$\!\+\,]+)/ism", 'red_zrl_callback', $body); + $body = preg_replace_callback("/([^\]\='".'"'."]|^|\#\^)(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\@\_\~\#\%\$\!\+\,]+)/ism", 'red_zrl_callback', $body); /** * -- cgit v1.2.3