aboutsummaryrefslogtreecommitdiffstats
path: root/mod/item.php
diff options
context:
space:
mode:
authorzottel <github@zottel.net>2014-02-17 08:17:47 +0100
committerzottel <github@zottel.net>2014-02-17 08:17:47 +0100
commit2bca2199112625593eb412584e17e874e71ca913 (patch)
treec6679ddb544217a10d8255578009c4ba8951bc6b /mod/item.php
parent54727d3a66df92596378ea7f5c412d5e6037b037 (diff)
parentf38ab0904101366bf536d46ab460dcd5cf4f60ca (diff)
downloadvolse-hubzilla-2bca2199112625593eb412584e17e874e71ca913.tar.gz
volse-hubzilla-2bca2199112625593eb412584e17e874e71ca913.tar.bz2
volse-hubzilla-2bca2199112625593eb412584e17e874e71ca913.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'mod/item.php')
-rw-r--r--mod/item.php8
1 files changed, 1 insertions, 7 deletions
diff --git a/mod/item.php b/mod/item.php
index fef9bfb6d..fa7720791 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -423,19 +423,13 @@ function item_post(&$a) {
/**
* fix naked links by passing through a callback to see if this is a red site
* (already known to us) which will get a zrl, otherwise link with url, add bookmark tag to both.
- * First wrap any url which is part of link anchor text already in quotes so we don't double link it.
- * e.g. [url=http://foobar.com]something with http://elsewhere.com in it[/url]
- * becomes [url=http://foobar.com]something with "http://elsewhere.com" in it[/url]
- * otherwise http://elsewhere.com becomes #^[url=http://elsewhere.com]http://elsewhere.com[/url]
+ * First protect any url inside certain bbcode tags so we don't double link it.
*/
$body = preg_replace_callback('/\[code(.*?)\[\/(code)\]/ism','red_escape_codeblock',$body);
$body = preg_replace_callback('/\[url(.*?)\[\/(url)\]/ism','red_escape_codeblock',$body);
$body = preg_replace_callback('/\[zrl(.*?)\[\/(zrl)\]/ism','red_escape_codeblock',$body);
-// no longer needed
-// $body = preg_replace_callback('/\[([uz])rl(.*?)\](.*?)(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\@\_\~\#\%\$\!\+\,]+)(.*?)\[\/([uz])rl\]/ism','red_escape_zrl_callback',$body);
-
$body = preg_replace_callback("/([^\]\='".'"'."]|^|\#\^)(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\@\_\~\#\%\$\!\+\,]+)/ism", 'red_zrl_callback', $body);
$body = preg_replace_callback('/\[\$b64zrl(.*?)\[\/(zrl)\]/ism','red_unescape_codeblock',$body);