From: Hypolite Petovan Date: Mon, 5 Mar 2018 02:58:58 +0000 (-0500) Subject: [diaspora|libertree] Move bb2diaspora to BBCode::toMarkdown X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=615568ed3576e51f383ac0cf5764e8d6bdda0870;p=friendica-addons.git [diaspora|libertree] Move bb2diaspora to BBCode::toMarkdown --- diff --git a/diaspora/diaspora.php b/diaspora/diaspora.php index 49a9cfc4..04d3c7ec 100644 --- a/diaspora/diaspora.php +++ b/diaspora/diaspora.php @@ -9,6 +9,7 @@ require_once 'addon/diaspora/Diaspora_Connection.php'; +use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\L10n; use Friendica\Core\PConfig; @@ -303,10 +304,8 @@ function diaspora_send(&$a,&$b) { $aspect = PConfig::get($b['uid'],'diaspora','aspect'); if ($handle && $password) { - logger('diaspora_send: all values seem to be okay', LOGGER_DEBUG); - require_once('include/bb2diaspora.php'); $tag_arr = []; $tags = ''; $x = preg_match_all('/\#\[(.*?)\](.*?)\[/',$b['tag'],$matches,PREG_SET_ORDER); @@ -338,7 +337,7 @@ function diaspora_send(&$a,&$b) { } while ($oldbody != $body); // convert to markdown - $body = bb2diaspora($body); + $body = BBCode::toMarkdown($body); // Adding the title if(strlen($title)) diff --git a/libertree/libertree.php b/libertree/libertree.php index 06851238..4d159bf0 100644 --- a/libertree/libertree.php +++ b/libertree/libertree.php @@ -5,6 +5,8 @@ * Version: 1.0 * Author: Tony Baldwin */ + +use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\L10n; use Friendica\Core\PConfig; @@ -184,8 +186,6 @@ function libertree_send(&$a,&$b) { $ltree_source .= " (".$b['app'].")"; if($ltree_url && $ltree_api_token && $ltree_blog && $ltree_source) { - - require_once('include/bb2diaspora.php'); $tag_arr = []; $tags = ''; $x = preg_match_all('/\#\[(.*?)\](.*?)\[/',$b['tag'],$matches,PREG_SET_ORDER); @@ -217,7 +217,7 @@ function libertree_send(&$a,&$b) { } while ($oldbody != $body); // convert to markdown - $body = bb2diaspora($body, false); + $body = BBCode::toMarkdown($body, false); // Adding the title if(strlen($title))