Browse Source

Rename class to BBCode

Rename Plaintext class to BBCode
pull/4335/head
Adam Magness 4 years ago
parent
commit
177edd2b6e
  1. 4
      include/api.php
  2. 6
      include/bbcode.php
  3. 6
      mod/item.php
  4. 4
      src/Content/Text/BBCode.php
  5. 6
      src/Protocol/OStatus.php

4
include/api.php

@ -8,7 +8,7 @@
use Friendica\App;
use Friendica\Content\ContactSelector;
use Friendica\Content\Feature;
use Friendica\Content\Text\Plaintext;
use Friendica\Content\Text\BBCode;
use Friendica\Core\Addon;
use Friendica\Core\System;
use Friendica\Core\Config;
@ -5196,7 +5196,7 @@ function api_clean_plain_items($Text)
*/
function api_clean_attachments($body)
{
$data = Plaintext::getAttachmentData($body);
$data = BBCode::getAttachmentData($body);
if (!$data) {
return $body;

6
include/bbcode.php

@ -5,7 +5,7 @@
use Friendica\App;
use Friendica\Content\Smilies;
use Friendica\Content\OEmbed;
use Friendica\Content\Text\Plaintext;
use Friendica\Content\Text\BBCode;
use Friendica\Core\Addon;
use Friendica\Core\Cache;
use Friendica\Core\L10n;
@ -57,7 +57,7 @@ function bb_map_location($match) {
*/
function bb_attachment($return, $simplehtml = false, $tryoembed = true)
{
$data = Plaintext::getAttachmentData($return);
$data = BBCode::getAttachmentData($return);
if (!$data) {
return $return;
}
@ -120,7 +120,7 @@ function bb_attachment($return, $simplehtml = false, $tryoembed = true)
function bb_remove_share_information($Text, $plaintext = false, $nolink = false) {
$data = Plaintext::getAttachmentData($Text);
$data = BBCode::getAttachmentData($Text);
if (!$data) {
return $Text;

6
mod/item.php

@ -15,7 +15,7 @@
* information.
*/
use Friendica\App;
use Friendica\Content\Text\Plaintext;
use Friendica\Content\Text\BBCode;
use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\L10n;
@ -507,7 +507,7 @@ function item_post(App $a) {
// embedded bookmark or attachment in post? set bookmark flag
$bookmark = 0;
$data = Plaintext::getAttachmentData($body);
$data = BBCode::getAttachmentData($body);
if (preg_match_all("/\[bookmark\=([^\]]*)\](.*?)\[\/bookmark\]/ism", $body, $match, PREG_SET_ORDER) || isset($data["type"])) {
$objecttype = ACTIVITY_OBJ_BOOKMARK;
$bookmark = 1;
@ -524,7 +524,7 @@ function item_post(App $a) {
// Setting the object type if not defined before
if (!$objecttype) {
$objecttype = ACTIVITY_OBJ_NOTE; // Default value
$objectdata = Plaintext::getAttachedData($body);
$objectdata = BBCode::getAttachedData($body);
if ($objectdata["type"] == "link") {
$objecttype = ACTIVITY_OBJ_BOOKMARK;

4
src/Content/Text/Plaintext.php → src/Content/Text/BBCode.php

@ -1,6 +1,6 @@
<?php
/**
* @file src/Content/Text/Plaintext.php
* @file src/Content/Text/BBCode.php
*/
namespace Friendica\Content\Text;
@ -13,7 +13,7 @@ require_once "include/bbcode.php";
require_once "include/html2plain.php";
require_once "include/network.php";
class Plaintext
class BBCode
{
/**
* @brief Fetches attachment data that were generated the old way

6
src/Protocol/OStatus.php

@ -5,7 +5,7 @@
namespace Friendica\Protocol;
use Friendica\App;
use Friendica\Content\Text\Plaintext;
use Friendica\Content\Text\BBCode;
use Friendica\Core\Cache;
use Friendica\Core\Config;
use Friendica\Core\L10n;
@ -1206,7 +1206,7 @@ class OStatus
*/
private static function formatPicturePost($body)
{
$siteinfo = Plaintext::getAttachedData($body);
$siteinfo = BBCode::getAttachedData($body);
if (($siteinfo["type"] == "photo")) {
if (isset($siteinfo["preview"])) {
@ -1328,7 +1328,7 @@ class OStatus
private static function getAttachment($doc, $root, $item)
{
$o = "";
$siteinfo = Plaintext::getAttachedData($item["body"]);
$siteinfo = BBCode::getAttachedData($item["body"]);
switch ($siteinfo["type"]) {
case 'photo':

Loading…
Cancel
Save