From: Hypolite Petovan Date: Sat, 21 Apr 2018 08:12:50 +0000 (-0400) Subject: Move BBCode::toPlaintext to Item::getPlaintextPost X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=776aae91478441e13159e57dd2357c6e07232d64;p=friendica-addons.git Move BBCode::toPlaintext to Item::getPlaintextPost --- diff --git a/buffer/buffer.php b/buffer/buffer.php index bb1d8482..27e54f55 100644 --- a/buffer/buffer.php +++ b/buffer/buffer.php @@ -8,12 +8,12 @@ require 'addon/buffer/bufferapp.php'; use Friendica\App; -use Friendica\Content\Text\BBCode; use Friendica\Content\Text\Plaintext; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\PConfig; +use Friendica\Model\Item; function buffer_install() { Addon::registerHook('post_local', 'addon/buffer/buffer.php', 'buffer_post_local'); @@ -338,7 +338,7 @@ function buffer_send(App $a, &$b) $item["body"] = preg_replace("(\[s\](.*?)\[\/s\])ism",'-$1-',$item["body"]); } - $post = BBCode::toPlaintext($item, $limit, $includedlinks, $htmlmode); + $post = Item::getPlaintextPost($item, $limit, $includedlinks, $htmlmode); logger("buffer_send: converted message ".$b["id"]." result: ".print_r($post, true), LOGGER_DEBUG); // The image proxy is used as a sanitizer. Buffer seems to be really picky about pictures diff --git a/statusnet/statusnet.php b/statusnet/statusnet.php index ad2da322..09254f7f 100644 --- a/statusnet/statusnet.php +++ b/statusnet/statusnet.php @@ -550,7 +550,7 @@ function statusnet_post_hook(App $a, &$b) PConfig::set($b['uid'], 'statusnet', 'max_char', $max_char); $tempfile = ""; - $msgarr = BBCode::toPlaintext($b, $max_char, true, 7); + $msgarr = Item::getPlaintextPost($b, $max_char, true, 7); $msg = $msgarr["text"]; if (($msg == "") && isset($msgarr["title"])) @@ -709,7 +709,7 @@ function statusnet_prepare_body(App $a, &$b) } } - $msgarr = BBCode::toPlaintext($item, $max_char, true, 7); + $msgarr = Item::getPlaintextPost($item, $max_char, true, 7); $msg = $msgarr["text"]; if (isset($msgarr["url"]) && ($msgarr["type"] != "photo")) { diff --git a/twitter/twitter.php b/twitter/twitter.php index 5036f515..c76ecf0c 100644 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -532,7 +532,7 @@ function twitter_post_hook(App $a, &$b) $connection->setTimeouts(10, 30); $max_char = 280; - $msgarr = BBCode::toPlaintext($b, $max_char, true, 8); + $msgarr = Item::getPlaintextPost($b, $max_char, true, 8); $msg = $msgarr["text"]; if (($msg == "") && isset($msgarr["title"])) { @@ -766,7 +766,7 @@ function twitter_prepare_body(App $a, &$b) } } - $msgarr = BBCode::toPlaintext($item, $max_char, true, 8); + $msgarr = Item::getPlaintextPost($item, $max_char, true, 8); $msg = $msgarr["text"]; if (isset($msgarr["url"]) && ($msgarr["type"] != "photo")) {