From f4e38b6ee9f88afbf5eaba9eba8523fe0295dd01 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 14 Feb 2018 21:38:37 -0500 Subject: [PATCH 1/5] Fix use statements --- dwpost/dwpost.php | 2 +- ijpost/ijpost.php | 2 +- ljpost/ljpost.php | 2 +- pumpio/pumpio.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dwpost/dwpost.php b/dwpost/dwpost.php index 6a9cfe52..d9d06675 100644 --- a/dwpost/dwpost.php +++ b/dwpost/dwpost.php @@ -11,8 +11,8 @@ use Friendica\Core\Addon; use Friendica\Core\L10n; use Friendica\Core\PConfig; +use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; -use Friendica\Util\Temporal; function dwpost_install() { Addon::registerHook('post_local', 'addon/dwpost/dwpost.php', 'dwpost_post_local'); diff --git a/ijpost/ijpost.php b/ijpost/ijpost.php index ffafa5ee..cd4d72cd 100644 --- a/ijpost/ijpost.php +++ b/ijpost/ijpost.php @@ -11,8 +11,8 @@ use Friendica\Core\Addon; use Friendica\Core\L10n; use Friendica\Core\PConfig; +use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; -use Friendica\Util\Temporal; function ijpost_install() { Addon::registerHook('post_local', 'addon/ijpost/ijpost.php', 'ijpost_post_local'); diff --git a/ljpost/ljpost.php b/ljpost/ljpost.php index de62c976..8fbc3b11 100644 --- a/ljpost/ljpost.php +++ b/ljpost/ljpost.php @@ -11,8 +11,8 @@ use Friendica\Core\Addon; use Friendica\Core\L10n; use Friendica\Core\PConfig; +use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; -use Friendica\Util\Temporal; function ljpost_install() { Addon::registerHook('post_local', 'addon/ljpost/ljpost.php', 'ljpost_post_local'); diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index 8e194f85..6a7a08cf 100644 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.php @@ -16,9 +16,9 @@ use Friendica\Model\GContact; use Friendica\Model\Group; use Friendica\Model\Item; use Friendica\Model\Queue; -use Friendica\Util\Network; use Friendica\Model\User; use Friendica\Util\DateTimeFormat; +use Friendica\Util\Network; require 'addon/pumpio/oauth/http.php'; require 'addon/pumpio/oauth/oauth_client.php'; From 91fd77af3b2cff61ad474f52a13e733cd696098e Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 14 Feb 2018 21:43:40 -0500 Subject: [PATCH 2/5] Refactor bbcode() into BBCode::convert() --- blogger/blogger.php | 4 +++- dwpost/dwpost.php | 3 ++- ijpost/ijpost.php | 3 ++- impressum/impressum.php | 7 ++++--- ljpost/ljpost.php | 3 ++- mailstream/mailstream.php | 6 ++++-- newmemberwidget/newmemberwidget.php | 3 ++- notifyall/notifyall.php | 6 ++++-- pumpio/pumpio.php | 3 ++- tumblr/tumblr.php | 12 ++++++------ windowsphonepush/windowsphonepush.php | 4 +++- wppost/wppost.php | 6 +++--- 12 files changed, 37 insertions(+), 23 deletions(-) diff --git a/blogger/blogger.php b/blogger/blogger.php index 7dfbcc4a..76c12bbb 100644 --- a/blogger/blogger.php +++ b/blogger/blogger.php @@ -5,6 +5,8 @@ * Version: 1.0 * */ + +use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\L10n; use Friendica\Core\PConfig; @@ -184,7 +186,7 @@ function blogger_send(&$a, &$b) require_once('include/bbcode.php'); $title = '' . (($b['title']) ? $b['title'] : L10n::t('Post from Friendica')) . ''; - $post = $title . bbcode($b['body']); + $post = $title . BBCode::convert($b['body']); $post = xmlify($post); $xml = <<< EOT diff --git a/dwpost/dwpost.php b/dwpost/dwpost.php index d9d06675..7e8488c3 100644 --- a/dwpost/dwpost.php +++ b/dwpost/dwpost.php @@ -8,6 +8,7 @@ * Author: Cat Gray */ +use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\L10n; use Friendica\Core\PConfig; @@ -182,7 +183,7 @@ function dwpost_send(&$a,&$b) { require_once('include/bbcode.php'); $title = $b['title']; - $post = bbcode($b['body']); + $post = BBCode::convert($b['body']); $post = xmlify($post); $tags = dwpost_get_tags($b['tag']); diff --git a/ijpost/ijpost.php b/ijpost/ijpost.php index cd4d72cd..5ccb6761 100644 --- a/ijpost/ijpost.php +++ b/ijpost/ijpost.php @@ -8,6 +8,7 @@ * Author: Cat Gray */ +use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\L10n; use Friendica\Core\PConfig; @@ -182,7 +183,7 @@ function ijpost_send(&$a,&$b) { require_once('include/datetime.php'); $title = $b['title']; - $post = bbcode($b['body']); + $post = BBCode::convert($b['body']); $post = xmlify($post); $tags = ijpost_get_tags($b['tag']); diff --git a/impressum/impressum.php b/impressum/impressum.php index 3a5efbcc..ae6ddf18 100644 --- a/impressum/impressum.php +++ b/impressum/impressum.php @@ -10,6 +10,7 @@ require_once 'include/bbcode.php'; require_once 'mod/proxy.php'; +use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; @@ -39,7 +40,7 @@ function obfuscate_email ($s) { return $s; } function impressum_footer($a, &$b) { - $text = proxy_parse_html(bbcode(Config::get('impressum','footer_text'), true)); + $text = proxy_parse_html(BBCode::convert(Config::get('impressum','footer_text'))); if (! $text == '') { $a->page['htmlhead'] .= ''; $b .= '
'; @@ -50,8 +51,8 @@ function impressum_show($a,&$b) { $b .= '

'.L10n::t('Impressum').'

'; $owner = Config::get('impressum', 'owner'); $owner_profile = Config::get('impressum','ownerprofile'); - $postal = proxy_parse_html(bbcode(Config::get('impressum', 'postal'), true)); - $notes = proxy_parse_html(bbcode(Config::get('impressum', 'notes'), true)); + $postal = proxy_parse_html(BBCode::convert(Config::get('impressum', 'postal'))); + $notes = proxy_parse_html(BBCode::convert(Config::get('impressum', 'notes'))); $email = obfuscate_email( Config::get('impressum','email') ); if (strlen($owner)) { if (strlen($owner_profile)) { diff --git a/ljpost/ljpost.php b/ljpost/ljpost.php index 8fbc3b11..97daf519 100644 --- a/ljpost/ljpost.php +++ b/ljpost/ljpost.php @@ -8,6 +8,7 @@ * Author: Cat Gray */ +use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\L10n; use Friendica\Core\PConfig; @@ -182,7 +183,7 @@ function ljpost_send(&$a,&$b) { require_once('include/bbcode.php'); $title = xmlify($b['title']); - $post = bbcode($b['body']); + $post = BBCode::convert($b['body']); $post = xmlify($post); $tags = ljpost_get_tags($b['tag']); diff --git a/mailstream/mailstream.php b/mailstream/mailstream.php index 4ff4c69d..acab5914 100644 --- a/mailstream/mailstream.php +++ b/mailstream/mailstream.php @@ -5,6 +5,8 @@ * Version: 1.1 * Author: Matthew Exon */ + +use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; @@ -180,7 +182,7 @@ function mailstream_sender($item) { } function mailstream_decode_subject($subject) { - $html = bbcode($subject); + $html = BBCode::convert($subject); if (!$html) { return $subject; } @@ -285,7 +287,7 @@ function mailstream_send($a, $message_id, $item, $user) { $mail->IsHTML(true); $mail->CharSet = 'utf-8'; $template = get_markup_template('mail.tpl', 'addon/mailstream/'); - $item['body'] = bbcode($item['body']); + $item['body'] = BBCode::convert($item['body']); $item['url'] = $a->get_baseurl() . '/display/' . $user['nickname'] . '/' . $item['id']; $mail->Body = replace_macros($template, [ '$upstream' => L10n::t('Upstream'), diff --git a/newmemberwidget/newmemberwidget.php b/newmemberwidget/newmemberwidget.php index 807c05a5..6ea83367 100644 --- a/newmemberwidget/newmemberwidget.php +++ b/newmemberwidget/newmemberwidget.php @@ -8,6 +8,7 @@ require_once 'include/bbcode.php'; +use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; @@ -31,7 +32,7 @@ function newmemberwidget_network_mod_init ( $a, $b) { $t .= ''.L10n::t('Local Support Forum').'
'.EOL; $ft = Config::get('newmemberwidget','freetext'); if (!trim($ft)=="") - $t .= '

'.bbcode(trim($ft)).'

'; + $t .= '

'.BBCode::convert(trim($ft)).'

'; $t .= '
'; $a->page['aside'] = $t . $a->page['aside']; } diff --git a/notifyall/notifyall.php b/notifyall/notifyall.php index e35d7bf1..5ea0db38 100644 --- a/notifyall/notifyall.php +++ b/notifyall/notifyall.php @@ -7,6 +7,8 @@ * Author: Mike Macgirvin (Inital Author of the hubbwall Addon for the Hubzilla Project) * Author: Rabuzarus (Port to Friendica) */ + +use Friendica\Content\Text\BBCode; use Friendica\Core\L10n; use Friendica\Util\Emailer; @@ -49,9 +51,9 @@ function notifyall_post(&$a) { $subject = $_REQUEST['subject']; - $textversion = strip_tags(html_entity_decode(bbcode(stripslashes(str_replace(["\\r", "\\n"],[ "", "\n"], $text))),ENT_QUOTES,'UTF-8')); + $textversion = strip_tags(html_entity_decode(BBCode::convert(stripslashes(str_replace(["\\r", "\\n"], ["", "\n"], $text))), ENT_QUOTES, 'UTF-8')); - $htmlversion = bbcode(stripslashes(str_replace(["\\r","\\n"], ["","
\n"],$text))); + $htmlversion = BBCode::convert(stripslashes(str_replace(["\\r", "\\n"], ["", "
\n"], $text))); // if this is a test, send it only to the admin(s) // admin_email might be a comma separated list, but we need "a@b','c@d','e@f diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index 6a7a08cf..129f2738 100644 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.php @@ -6,6 +6,7 @@ * Author: Michael Vogel */ +use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; @@ -475,7 +476,7 @@ function pumpio_send(&$a,&$b) { $title = trim($b['title']); - $content = bbcode($b['body'], false, false, 4); + $content = BBCode::convert($b['body'], false, 4); $params = []; diff --git a/tumblr/tumblr.php b/tumblr/tumblr.php index 2ba26afc..831dd615 100644 --- a/tumblr/tumblr.php +++ b/tumblr/tumblr.php @@ -381,7 +381,7 @@ function tumblr_send(&$a,&$b) { switch ($siteinfo["type"]) { case "photo": $params['type'] = "photo"; - $params['caption'] = bbcode($body, false, false, 4); + $params['caption'] = BBCode::convert($body, false, 4); if (isset($siteinfo["url"])) $params['link'] = $siteinfo["url"]; @@ -392,22 +392,22 @@ function tumblr_send(&$a,&$b) { $params['type'] = "link"; $params['title'] = $title; $params['url'] = $siteinfo["url"]; - $params['description'] = bbcode($body, false, false, 4); + $params['description'] = BBCode::convert($body, false, 4); break; case "audio": $params['type'] = "audio"; $params['external_url'] = $siteinfo["url"]; - $params['caption'] = bbcode($body, false, false, 4); + $params['caption'] = BBCode::convert($body, false, 4); break; case "video": $params['type'] = "video"; $params['embed'] = $siteinfo["url"]; - $params['caption'] = bbcode($body, false, false, 4); + $params['caption'] = BBCode::convert($body, false, 4); break; default: $params['type'] = "text"; $params['title'] = $title; - $params['body'] = bbcode($b['body'], false, false, 4); + $params['body'] = BBCode::convert($b['body'], false, 4); break; } @@ -416,7 +416,7 @@ function tumblr_send(&$a,&$b) { "

".$params['caption']."

"; if (trim($params['caption']) == "") - $params['caption'] = bbcode("[quote]".$siteinfo["description"]."[/quote]", false, false, 4); + $params['caption'] = BBCode::convert("[quote]" . $siteinfo["description"] . "[/quote]", false, 4); $consumer_key = Config::get('tumblr','consumer_key'); $consumer_secret = Config::get('tumblr','consumer_secret'); diff --git a/windowsphonepush/windowsphonepush.php b/windowsphonepush/windowsphonepush.php index 033d2a64..346f550f 100644 --- a/windowsphonepush/windowsphonepush.php +++ b/windowsphonepush/windowsphonepush.php @@ -25,7 +25,9 @@ * sets the counter back * count only unseen elements which are not type=activity (likes and dislikes not seen as new elements) */ + use Friendica\App; +use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\L10n; use Friendica\Core\PConfig; @@ -211,7 +213,7 @@ function windowsphonepush_cron() } else { require_once('include/bbcode.php'); require_once("include/html2plain.php"); - $body = bbcode($body, false, false, 2, true); + $body = BBCode::convert($body, false, 2, true); $body = html2plain($body, 0); $body = ((strlen($body) > 137) ? substr($body, 0, 137) . "..." : $body); } diff --git a/wppost/wppost.php b/wppost/wppost.php index e3127e8e..23f928bc 100644 --- a/wppost/wppost.php +++ b/wppost/wppost.php @@ -145,7 +145,7 @@ function wppost_settings_post(&$a,&$b) { PConfig::set(local_user(),'wppost','backlink',trim($_POST['wp_backlink'])); PConfig::set(local_user(),'wppost','shortcheck',trim($_POST['wp_shortcheck'])); $wp_backlink_text = notags(trim($_POST['wp_backlink_text'])); - $wp_backlink_text = bbcode($wp_backlink_text, false, false, 8); + $wp_backlink_text = BBCode::convert($wp_backlink_text, false, 8); $wp_backlink_text = html2plain($wp_backlink_text, 0, true); PConfig::set(local_user(),'wppost','wp_backlink_text', $wp_backlink_text); @@ -266,7 +266,7 @@ function wppost_send(&$a,&$b) { // Remove the share element before fetching the first line $title = trim(preg_replace("/\[share.*?\](.*?)\[\/share\]/ism","\n$1\n",$b['body'])); - $title = html2plain(bbcode($title, false, false), 0, true)."\n"; + $title = html2plain(BBCode::convert($title, false), 0, true)."\n"; $pos = strpos($title, "\n"); $trailer = ""; if (($pos == 0) || ($pos > 100)) { @@ -279,7 +279,7 @@ function wppost_send(&$a,&$b) { } $title = '' . (($wptitle) ? $wptitle : L10n::t('Post from Friendica')) . ''; - $post = bbcode($b['body'], false, false, 4); + $post = BBCode::convert($b['body'], false, 4); // If a link goes to youtube then remove the stuff around it. Wordpress detects youtube links and embeds it $post = preg_replace('/(.*?)<\/a>/ism',"\n$1\n",$post); From ab23f858cb1673c3bbb11953cbc7877522c99efe Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 14 Feb 2018 21:46:33 -0500 Subject: [PATCH 3/5] Remove unused $preserve_nl parameter from bb2diaspora() --- diaspora/diaspora.php | 4 ++-- libertree/libertree.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/diaspora/diaspora.php b/diaspora/diaspora.php index b486c095..49a9cfc4 100644 --- a/diaspora/diaspora.php +++ b/diaspora/diaspora.php @@ -338,7 +338,7 @@ function diaspora_send(&$a,&$b) { } while ($oldbody != $body); // convert to markdown - $body = bb2diaspora($body, false, true); + $body = bb2diaspora($body); // Adding the title if(strlen($title)) @@ -367,7 +367,7 @@ function diaspora_send(&$a,&$b) { $a->contact = $r[0]["id"]; $s = serialize(['url' => $url, 'item' => $b['id'], 'post' => $body]); - + Queue::add($a->contact, NETWORK_DIASPORA2, $s); notice(L10n::t('Diaspora post failed. Queued for retry.').EOL); } diff --git a/libertree/libertree.php b/libertree/libertree.php index b48c9b18..06851238 100644 --- a/libertree/libertree.php +++ b/libertree/libertree.php @@ -217,7 +217,7 @@ function libertree_send(&$a,&$b) { } while ($oldbody != $body); // convert to markdown - $body = bb2diaspora($body, false, false); + $body = bb2diaspora($body, false); // Adding the title if(strlen($title)) From 16c3c2b93a6dddc7aed148d2df0665b9d7af78ef Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 14 Feb 2018 22:03:54 -0500 Subject: [PATCH 4/5] [ijpost] Remove rogue reference to include/datetime.php --- ijpost/ijpost.php | 1 - 1 file changed, 1 deletion(-) diff --git a/ijpost/ijpost.php b/ijpost/ijpost.php index 5ccb6761..439018f4 100644 --- a/ijpost/ijpost.php +++ b/ijpost/ijpost.php @@ -180,7 +180,6 @@ function ijpost_send(&$a,&$b) { if($ij_username && $ij_password && $ij_blog) { require_once('include/bbcode.php'); - require_once('include/datetime.php'); $title = $b['title']; $post = BBCode::convert($b['body']); From 88ca2f5a1e83c2cd93c6b08863fdd361a3a9bd69 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 14 Feb 2018 22:04:06 -0500 Subject: [PATCH 5/5] Remove references to include/bbcode.php --- blogger/blogger.php | 2 -- dwpost/dwpost.php | 3 --- ijpost/ijpost.php | 3 --- impressum/impressum.php | 1 - ljpost/ljpost.php | 3 --- mailstream/mailstream.php | 2 +- newmemberwidget/newmemberwidget.php | 2 -- pumpio/pumpio.php | 3 --- statusnet/statusnet.php | 1 - tumblr/tumblr.php | 3 --- windowsphonepush/windowsphonepush.php | 2 +- wppost/wppost.php | 1 - 12 files changed, 2 insertions(+), 24 deletions(-) diff --git a/blogger/blogger.php b/blogger/blogger.php index 76c12bbb..30c450bd 100644 --- a/blogger/blogger.php +++ b/blogger/blogger.php @@ -183,8 +183,6 @@ function blogger_send(&$a, &$b) $bl_blog = PConfig::get($b['uid'], 'blogger', 'bl_blog'); if ($bl_username && $bl_password && $bl_blog) { - require_once('include/bbcode.php'); - $title = '' . (($b['title']) ? $b['title'] : L10n::t('Post from Friendica')) . ''; $post = $title . BBCode::convert($b['body']); $post = xmlify($post); diff --git a/dwpost/dwpost.php b/dwpost/dwpost.php index 7e8488c3..a46f55b2 100644 --- a/dwpost/dwpost.php +++ b/dwpost/dwpost.php @@ -179,9 +179,6 @@ function dwpost_send(&$a,&$b) { $dw_blog = 'http://www.dreamwidth.org/interface/xmlrpc'; if($dw_username && $dw_password && $dw_blog) { - - require_once('include/bbcode.php'); - $title = $b['title']; $post = BBCode::convert($b['body']); $post = xmlify($post); diff --git a/ijpost/ijpost.php b/ijpost/ijpost.php index 439018f4..8d529085 100644 --- a/ijpost/ijpost.php +++ b/ijpost/ijpost.php @@ -178,9 +178,6 @@ function ijpost_send(&$a,&$b) { $ij_blog = 'http://www.insanejournal.com/interface/xmlrpc'; if($ij_username && $ij_password && $ij_blog) { - - require_once('include/bbcode.php'); - $title = $b['title']; $post = BBCode::convert($b['body']); $post = xmlify($post); diff --git a/impressum/impressum.php b/impressum/impressum.php index ae6ddf18..50458ee5 100644 --- a/impressum/impressum.php +++ b/impressum/impressum.php @@ -7,7 +7,6 @@ * License: 3-clause BSD license */ -require_once 'include/bbcode.php'; require_once 'mod/proxy.php'; use Friendica\Content\Text\BBCode; diff --git a/ljpost/ljpost.php b/ljpost/ljpost.php index 97daf519..ec99f9ba 100644 --- a/ljpost/ljpost.php +++ b/ljpost/ljpost.php @@ -179,9 +179,6 @@ function ljpost_send(&$a,&$b) { $lj_blog = xmlify('http://www.livejournal.com/interface/xmlrpc'); if($lj_username && $lj_password && $lj_blog) { - - require_once('include/bbcode.php'); - $title = xmlify($b['title']); $post = BBCode::convert($b['body']); $post = xmlify($post); diff --git a/mailstream/mailstream.php b/mailstream/mailstream.php index acab5914..6c057b21 100644 --- a/mailstream/mailstream.php +++ b/mailstream/mailstream.php @@ -257,7 +257,7 @@ function mailstream_send($a, $message_id, $item, $user) { return; } require_once(dirname(__file__).'/phpmailer/class.phpmailer.php'); - require_once('include/bbcode.php'); + $attachments = []; mailstream_do_images($a, $item, $attachments); $frommail = Config::get('mailstream', 'frommail'); diff --git a/newmemberwidget/newmemberwidget.php b/newmemberwidget/newmemberwidget.php index 6ea83367..57b49230 100644 --- a/newmemberwidget/newmemberwidget.php +++ b/newmemberwidget/newmemberwidget.php @@ -6,8 +6,6 @@ * Author: Tobias Diekershoff ***/ -require_once 'include/bbcode.php'; - use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\Config; diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index 129f2738..a1ca2ade 100644 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.php @@ -471,9 +471,6 @@ function pumpio_send(&$a,&$b) { $public = PConfig::get($b['uid'], "pumpio", "public"); if($oauth_token && $oauth_token_secret) { - - require_once('include/bbcode.php'); - $title = trim($b['title']); $content = BBCode::convert($b['body'], false, 4); diff --git a/statusnet/statusnet.php b/statusnet/statusnet.php index f1c080f4..c54ff55f 100644 --- a/statusnet/statusnet.php +++ b/statusnet/statusnet.php @@ -544,7 +544,6 @@ function statusnet_post_hook(App $a, &$b) return; } - require_once 'include/bbcode.php'; $dent = new StatusNetOAuth($api, $ckey, $csecret, $otoken, $osecret); $max_char = $dent->get_maxlength(); // max. length for a dent diff --git a/tumblr/tumblr.php b/tumblr/tumblr.php index 831dd615..b2dec5b5 100644 --- a/tumblr/tumblr.php +++ b/tumblr/tumblr.php @@ -342,9 +342,6 @@ function tumblr_send(&$a,&$b) { $tmbl_blog = 'blog/'.$page.'/post'; if($oauth_token && $oauth_token_secret && $tmbl_blog) { - - require_once('include/bbcode.php'); - $tag_arr = []; $tags = ''; $x = preg_match_all('/\#\[(.*?)\](.*?)\[/',$b['tag'],$matches,PREG_SET_ORDER); diff --git a/windowsphonepush/windowsphonepush.php b/windowsphonepush/windowsphonepush.php index 346f550f..206b0883 100644 --- a/windowsphonepush/windowsphonepush.php +++ b/windowsphonepush/windowsphonepush.php @@ -211,8 +211,8 @@ function windowsphonepush_cron() if (substr($body, 0, 4) == "[url") { $body = "URL/Image ..."; } else { - require_once('include/bbcode.php'); require_once("include/html2plain.php"); + $body = BBCode::convert($body, false, 2, true); $body = html2plain($body, 0); $body = ((strlen($body) > 137) ? substr($body, 0, 137) . "..." : $body); diff --git a/wppost/wppost.php b/wppost/wppost.php index 23f928bc..8d14b170 100644 --- a/wppost/wppost.php +++ b/wppost/wppost.php @@ -221,7 +221,6 @@ function wppost_send(&$a,&$b) { } if ($wp_username && $wp_password && $wp_blog) { - require_once 'include/bbcode.php'; require_once 'include/html2plain.php'; $wptitle = trim($b['title']);