aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Item.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2016-12-13 20:01:38 -0800
committerzotlabs <mike@macgirvin.com>2016-12-13 20:01:38 -0800
commit0394a3e93957b5bb6574ca95e290e414ed049404 (patch)
tree64763a081485babec1a5ca98ca87cbdf758ced2f /Zotlabs/Module/Item.php
parent8e400e9e40dc115d81bd03581ea6da3badec5a19 (diff)
downloadvolse-hubzilla-0394a3e93957b5bb6574ca95e290e414ed049404.tar.gz
volse-hubzilla-0394a3e93957b5bb6574ca95e290e414ed049404.tar.bz2
volse-hubzilla-0394a3e93957b5bb6574ca95e290e414ed049404.zip
tag and mention handling in private mail (which required refactoring the bbcode cleanup stuff in mod_item)
Diffstat (limited to 'Zotlabs/Module/Item.php')
-rw-r--r--Zotlabs/Module/Item.php36
1 files changed, 1 insertions, 35 deletions
diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php
index 085c02742..bebe5e89b 100644
--- a/Zotlabs/Module/Item.php
+++ b/Zotlabs/Module/Item.php
@@ -556,42 +556,8 @@ class Item extends \Zotlabs\Web\Controller {
if($x)
$body .= "\n\n@group+" . $x[0]['abook_id'] . "\n";
}
-
- /**
- * fix naked links by passing through a callback to see if this is a hubzilla site
- * (already known to us) which will get a zrl, otherwise link with url, add bookmark tag to both.
- * 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);
-
- $body = preg_replace_callback("/([^\]\='".'"'."\/]|^|\#\^)(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\@\_\~\#\%\$\!\+\,\(\)]+)/ism", 'nakedoembed', $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);
- $body = preg_replace_callback('/\[\$b64url(.*?)\[\/(url)\]/ism','\red_unescape_codeblock',$body);
- $body = preg_replace_callback('/\[\$b64code(.*?)\[\/(code)\]/ism','\red_unescape_codeblock',$body);
-
-
- // fix any img tags that should be zmg
-
- $body = preg_replace_callback('/\[img(.*?)\](.*?)\[\/img\]/ism','\red_zrlify_img_callback',$body);
-
-
- $body = bb_translate_video($body);
-
- /**
- * Fold multi-line [code] sequences
- */
-
- $body = preg_replace('/\[\/code\]\s*\[code\]/ism',"\n",$body);
-
- $body = scale_external_images($body,false);
-
+ $body = cleanup_bbcode($body);
// Look for tags and linkify them
$results = linkify_tags($a, $body, ($uid) ? $uid : $profile_uid);