Merge pull request #538 from MrPetovan/task/3878-move-bb2diaspora-to-src

[diaspora|libertree] Move bb2diaspora to BBCode::toMarkdown
pull/545/merge
Michael Vogel 2018-03-05 07:28:29 +01:00 committed by GitHub
commit 3b6779f5db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 6 deletions

View File

@ -9,6 +9,7 @@
require_once 'addon/diaspora/Diaspora_Connection.php'; require_once 'addon/diaspora/Diaspora_Connection.php';
use Friendica\Content\Text\BBCode;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
@ -303,10 +304,8 @@ function diaspora_send(&$a,&$b) {
$aspect = PConfig::get($b['uid'],'diaspora','aspect'); $aspect = PConfig::get($b['uid'],'diaspora','aspect');
if ($handle && $password) { if ($handle && $password) {
logger('diaspora_send: all values seem to be okay', LOGGER_DEBUG); logger('diaspora_send: all values seem to be okay', LOGGER_DEBUG);
require_once('include/bb2diaspora.php');
$tag_arr = []; $tag_arr = [];
$tags = ''; $tags = '';
$x = preg_match_all('/\#\[(.*?)\](.*?)\[/',$b['tag'],$matches,PREG_SET_ORDER); $x = preg_match_all('/\#\[(.*?)\](.*?)\[/',$b['tag'],$matches,PREG_SET_ORDER);
@ -338,7 +337,7 @@ function diaspora_send(&$a,&$b) {
} while ($oldbody != $body); } while ($oldbody != $body);
// convert to markdown // convert to markdown
$body = bb2diaspora($body); $body = BBCode::toMarkdown($body);
// Adding the title // Adding the title
if(strlen($title)) if(strlen($title))

View File

@ -5,6 +5,8 @@
* Version: 1.0 * Version: 1.0
* Author: Tony Baldwin <https://free-haven.org/u/tony> * Author: Tony Baldwin <https://free-haven.org/u/tony>
*/ */
use Friendica\Content\Text\BBCode;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
@ -184,8 +186,6 @@ function libertree_send(&$a,&$b) {
$ltree_source .= " (".$b['app'].")"; $ltree_source .= " (".$b['app'].")";
if($ltree_url && $ltree_api_token && $ltree_blog && $ltree_source) { if($ltree_url && $ltree_api_token && $ltree_blog && $ltree_source) {
require_once('include/bb2diaspora.php');
$tag_arr = []; $tag_arr = [];
$tags = ''; $tags = '';
$x = preg_match_all('/\#\[(.*?)\](.*?)\[/',$b['tag'],$matches,PREG_SET_ORDER); $x = preg_match_all('/\#\[(.*?)\](.*?)\[/',$b['tag'],$matches,PREG_SET_ORDER);
@ -217,7 +217,7 @@ function libertree_send(&$a,&$b) {
} while ($oldbody != $body); } while ($oldbody != $body);
// convert to markdown // convert to markdown
$body = bb2diaspora($body, false); $body = BBCode::toMarkdown($body, false);
// Adding the title // Adding the title
if(strlen($title)) if(strlen($title))