From ee380c3149febcc0eba327313e38e420ad9e84e2 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 14 Feb 2018 20:25:23 -0500 Subject: [PATCH 1/8] Fix undeclared variable in Content\Text\BBCode --- src/Content/Text/BBCode.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index 2ea15b0641..71daa1d145 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -1135,7 +1135,7 @@ class BBCode break; case 4: - $headline .= '
' . html_entity_decode("♲ ", ENT_QUOTES, 'UTF-8'); + $headline = '
' . html_entity_decode("♲ ", ENT_QUOTES, 'UTF-8'); $headline .= L10n::t('%2$s %3$s', $link, $userid, $posted); $headline .= ":
"; From 29f5270313b067e9cc1ce83ccfb79c4cb7b91d0c Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 14 Feb 2018 20:28:10 -0500 Subject: [PATCH 2/8] Remove unused parameter preserve_nl in BBCode::convert --- include/bbcode.php | 2 +- src/Content/Text/BBCode.php | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/include/bbcode.php b/include/bbcode.php index ab211e5549..0bda691acc 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -7,5 +7,5 @@ use Friendica\Content\Text\BBCode; function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = false, $forplaintext = false) { - return BBCode::convert($Text, $preserve_nl, $tryoembed, $simplehtml, $forplaintext); + return BBCode::convert($Text, $tryoembed, $simplehtml, $forplaintext); } diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index 71daa1d145..a81b69e34b 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -1342,13 +1342,12 @@ class BBCode * - 8: Used for WP backlink text setting * * @param string $text - * @param bool $preserve_nl * @param bool $try_oembed * @param int $simple_html * @param bool $for_plaintext * @return string */ - public static function convert($text, $preserve_nl = false, $try_oembed = true, $simple_html = false, $for_plaintext = false) + public static function convert($text, $try_oembed = true, $simple_html = false, $for_plaintext = false) { $a = get_app(); @@ -1473,10 +1472,6 @@ class BBCode $text = str_replace(["\r","\n"], ['
', '
'], $text); - if ($preserve_nl) { - $text = str_replace(["\n", "\r"], ['', ''], $text); - } - // Remove all hashtag addresses if ((!$try_oembed || $simple_html) && !in_array($simple_html, [3, 7])) { $text = preg_replace("/([#@!])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", '$1$3', $text); From 0c52866693add20fc4476e26a5c7ae14f5d5272a Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 14 Feb 2018 21:33:55 -0500 Subject: [PATCH 3/8] Refactor bbcode() into BBCode::convert() --- include/api.php | 39 +++++++++++++++---------------- include/bb2diaspora.php | 4 ++-- include/enotify.php | 9 +++---- include/event.php | 19 ++++++++------- include/text.php | 7 +++--- mod/babel.php | 4 +++- mod/contacts.php | 7 +++--- mod/display.php | 5 ++-- mod/message.php | 3 ++- mod/notify.php | 3 ++- mod/photos.php | 6 ++--- mod/ping.php | 5 ++-- mod/poco.php | 3 ++- mod/register.php | 5 ++-- mod/tagrm.php | 4 +++- src/Content/Text/BBCode.php | 6 ++--- src/Core/NotificationsManager.php | 9 +++---- src/Model/Profile.php | 11 +++++---- src/Protocol/DFRN.php | 4 ++-- src/Protocol/Diaspora.php | 3 ++- src/Protocol/OStatus.php | 6 ++--- 21 files changed, 89 insertions(+), 73 deletions(-) diff --git a/include/api.php b/include/api.php index 67df83fe14..013d47fe23 100644 --- a/include/api.php +++ b/include/api.php @@ -2604,13 +2604,12 @@ function api_format_messages($item, $recipient, $sender) if (x($_GET, 'getText')) { $ret['title'] = $item['title']; if ($_GET['getText'] == 'html') { - $ret['text'] = bbcode($item['body'], false, false); + $ret['text'] = BBCode::convert($item['body'], false); } elseif ($_GET['getText'] == 'plain') { - //$ret['text'] = html2plain(bbcode($item['body'], false, false, true), 0); - $ret['text'] = trim(html2plain(bbcode(api_clean_plain_items($item['body']), false, false, 2, true), 0)); + $ret['text'] = trim(html2plain(BBCode::convert(api_clean_plain_items($item['body']), false, 2, true), 0)); } } else { - $ret['text'] = $item['title'] . "\n" . html2plain(bbcode(api_clean_plain_items($item['body']), false, false, 2, true), 0); + $ret['text'] = $item['title'] . "\n" . html2plain(BBCode::convert(api_clean_plain_items($item['body']), false, 2, true), 0); } if (x($_GET, 'getUserObjects') && $_GET['getUserObjects'] == 'false') { unset($ret['sender']); @@ -2632,7 +2631,7 @@ function api_convert_item($item) $attachments = api_get_attachments($body); // Workaround for ostatus messages where the title is identically to the body - $html = bbcode(api_clean_plain_items($body), false, false, 2, true); + $html = BBCode::convert(api_clean_plain_items($body), false, 2, true); $statusbody = trim(html2plain($html, 0)); // handle data: images @@ -2650,7 +2649,7 @@ function api_convert_item($item) $statustext = substr($statustext, 0, 1000)."... \n".$item["plink"]; } - $statushtml = bbcode(api_clean_attachments($body), false, false); + $statushtml = BBCode::convert(api_clean_attachments($body), false); // Workaround for clients with limited HTML parser functionality $search = ["
", "
", "
", @@ -2664,7 +2663,7 @@ function api_convert_item($item) $statushtml = str_replace($search, $replace, $statushtml); if ($item['title'] != "") { - $statushtml = "

" . bbcode($item['title']) . "


" . $statushtml; + $statushtml = "

" . BBCode::convert($item['title']) . "


" . $statushtml; } do { @@ -2682,7 +2681,7 @@ function api_convert_item($item) // feeds without body should contain the link if (($item['network'] == NETWORK_FEED) && (strlen($item['body']) == 0)) { - $statushtml .= bbcode($item['plink']); + $statushtml .= BBCode::convert($item['plink']); } $entities = api_get_entitities($statustext, $body); @@ -3053,18 +3052,18 @@ function api_format_items_profiles($profile_row) 'religion' => $profile_row['religion'], 'public_keywords' => $profile_row['pub_keywords'], 'private_keywords' => $profile_row['prv_keywords'], - 'likes' => bbcode(api_clean_plain_items($profile_row['likes']) , false, false, 2, false), - 'dislikes' => bbcode(api_clean_plain_items($profile_row['dislikes']) , false, false, 2, false), - 'about' => bbcode(api_clean_plain_items($profile_row['about']) , false, false, 2, false), - 'music' => bbcode(api_clean_plain_items($profile_row['music']) , false, false, 2, false), - 'book' => bbcode(api_clean_plain_items($profile_row['book']) , false, false, 2, false), - 'tv' => bbcode(api_clean_plain_items($profile_row['tv']) , false, false, 2, false), - 'film' => bbcode(api_clean_plain_items($profile_row['film']) , false, false, 2, false), - 'interest' => bbcode(api_clean_plain_items($profile_row['interest']) , false, false, 2, false), - 'romance' => bbcode(api_clean_plain_items($profile_row['romance']) , false, false, 2, false), - 'work' => bbcode(api_clean_plain_items($profile_row['work']) , false, false, 2, false), - 'education' => bbcode(api_clean_plain_items($profile_row['education']), false, false, 2, false), - 'social_networks' => bbcode(api_clean_plain_items($profile_row['contact']) , false, false, 2, false), + 'likes' => BBCode::convert(api_clean_plain_items($profile_row['likes']) , false, 2), + 'dislikes' => BBCode::convert(api_clean_plain_items($profile_row['dislikes']) , false, 2), + 'about' => BBCode::convert(api_clean_plain_items($profile_row['about']) , false, 2), + 'music' => BBCode::convert(api_clean_plain_items($profile_row['music']) , false, 2), + 'book' => BBCode::convert(api_clean_plain_items($profile_row['book']) , false, 2), + 'tv' => BBCode::convert(api_clean_plain_items($profile_row['tv']) , false, 2), + 'film' => BBCode::convert(api_clean_plain_items($profile_row['film']) , false, 2), + 'interest' => BBCode::convert(api_clean_plain_items($profile_row['interest']) , false, 2), + 'romance' => BBCode::convert(api_clean_plain_items($profile_row['romance']) , false, 2), + 'work' => BBCode::convert(api_clean_plain_items($profile_row['work']) , false, 2), + 'education' => BBCode::convert(api_clean_plain_items($profile_row['education']), false, 2), + 'social_networks' => BBCode::convert(api_clean_plain_items($profile_row['contact']) , false, 2), 'homepage' => $profile_row['homepage'], 'users' => null ]; diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index c1c9fa4c3d..7e20037a0b 100644 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -164,7 +164,7 @@ function bb2diaspora($Text, $preserve_nl = false, $fordiaspora = true) { // Convert it to HTML - don't try oembed if ($fordiaspora) { - $Text = bbcode($Text, $preserve_nl, false, 3); + $Text = BBCode::convert($Text, false, 3); // Add all tags that maybe were removed if (preg_match_all("/#\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", $OriginalText, $tags)) { @@ -178,7 +178,7 @@ function bb2diaspora($Text, $preserve_nl = false, $fordiaspora = true) { $Text = $Text." ".$tagline; } } else { - $Text = bbcode($Text, $preserve_nl, false, 4); + $Text = BBCode::convert($Text, false, 4); } // mask some special HTML chars from conversation to markdown diff --git a/include/enotify.php b/include/enotify.php index 2b8c36e257..2b6eec576c 100644 --- a/include/enotify.php +++ b/include/enotify.php @@ -3,6 +3,7 @@ * @file include/enotify.php */ +use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; @@ -448,7 +449,7 @@ function notification($params) $datarray = []; $datarray['hash'] = $hash; $datarray['name'] = $params['source_name']; - $datarray['name_cache'] = strip_tags(bbcode($params['source_name'])); + $datarray['name_cache'] = strip_tags(BBCode::convert($params['source_name'])); $datarray['url'] = $params['source_link']; $datarray['photo'] = $params['source_photo']; $datarray['date'] = DateTimeFormat::utcNow(); @@ -519,7 +520,7 @@ function notification($params) $itemlink = System::baseUrl().'/notify/view/'.$notify_id; $msg = replace_macros($epreamble, ['$itemlink' => $itemlink]); - $msg_cache = format_notification_message($datarray['name_cache'], strip_tags(bbcode($msg))); + $msg_cache = format_notification_message($datarray['name_cache'], strip_tags(BBCode::convert($msg))); q("UPDATE `notify` SET `msg` = '%s', `msg_cache` = '%s' WHERE `id` = %d AND `uid` = %d", dbesc($msg), dbesc($msg_cache), @@ -567,9 +568,9 @@ function notification($params) } // textversion keeps linebreaks - $textversion = strip_tags(str_replace("
", "\n", html_entity_decode(bbcode(stripslashes(str_replace(["\\r\\n", "\\r", "\\n"], "\n", + $textversion = strip_tags(str_replace("
", "\n", html_entity_decode(BBCode::convert(stripslashes(str_replace(["\\r\\n", "\\r", "\\n"], "\n", $body))),ENT_QUOTES, 'UTF-8'))); - $htmlversion = html_entity_decode(bbcode(stripslashes(str_replace(["\\r\\n", "\\r", "\\n\\n", "\\n"], + $htmlversion = html_entity_decode(BBCode::convert(stripslashes(str_replace(["\\r\\n", "\\r", "\\n\\n", "\\n"], "
\n", $body))), ENT_QUOTES, 'UTF-8'); $datarray = []; diff --git a/include/event.php b/include/event.php index cce2a98cc0..c86ba732b8 100644 --- a/include/event.php +++ b/include/event.php @@ -5,6 +5,7 @@ */ use Friendica\Content\Feature; +use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\L10n; use Friendica\Core\PConfig; @@ -38,9 +39,9 @@ function format_event_html($ev, $simple = false) { ); if ($simple) { - $o = "

" . bbcode($ev['summary']) . "

"; + $o = "

" . BBCode::convert($ev['summary']) . "

"; - $o .= "
" . bbcode($ev['desc']) . "
"; + $o .= "
" . BBCode::convert($ev['desc']) . "
"; $o .= "

" . L10n::t('Starts:') . "

" . $event_start . "

"; @@ -57,7 +58,7 @@ function format_event_html($ev, $simple = false) { $o = '
' . "\r\n"; - $o .= '
' . bbcode($ev['summary']) . '
' . "\r\n"; + $o .= '
' . BBCode::convert($ev['summary']) . '
' . "\r\n"; $o .= '
' . L10n::t('Starts:') . ' ' . "\r\n"; + $o .= '
' . BBCode::convert($ev['desc']) . '
' . "\r\n"; if (strlen($ev['location'])) { $o .= '
' . L10n::t('Location:') . ' ' - . bbcode($ev['location']) + . BBCode::convert($ev['location']) . '
' . "\r\n"; // Include a map of the location if the [map] BBCode is used. @@ -610,15 +611,15 @@ function process_events($arr) { $drop = [System::baseUrl() . '/events/drop/' . $rr['id'], L10n::t('Delete event'), '', '']; } - $title = strip_tags(html_entity_decode(bbcode($rr['summary']), ENT_QUOTES, 'UTF-8')); + $title = strip_tags(html_entity_decode(BBCode::convert($rr['summary']), ENT_QUOTES, 'UTF-8')); if (! $title) { - list($title, $_trash) = explode(" $rr['id'], 'start' => $start, diff --git a/include/text.php b/include/text.php index ca88091d4f..ee5d4763ef 100644 --- a/include/text.php +++ b/include/text.php @@ -7,6 +7,7 @@ use Friendica\App; use Friendica\Content\ContactSelector; use Friendica\Content\Feature; use Friendica\Content\Smilies; +use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; @@ -15,7 +16,7 @@ use Friendica\Core\System; use Friendica\Database\DBM; use Friendica\Model\Item; use Friendica\Model\Profile; -use Friendica\Model\Term; +use Friendica\Render\FriendicaSmarty; use Friendica\Util\DateTimeFormat; use Friendica\Util\Map; @@ -1427,9 +1428,9 @@ function prepare_text($text) { require_once 'include/bbcode.php'; if (stristr($text, '[nosmile]')) { - $s = bbcode($text); + $s = BBCode::convert($text); } else { - $s = Smilies::replace(bbcode($text)); + $s = Smilies::replace(BBCode::convert($text)); } return trim($s); diff --git a/mod/babel.php b/mod/babel.php index 3b4fb5bf2b..683bc5fed1 100644 --- a/mod/babel.php +++ b/mod/babel.php @@ -2,6 +2,8 @@ /** * @file mod/babel.php */ + +use Friendica\Content\Text\BBCode; use Friendica\Content\Text\Markdown; use Friendica\Core\L10n; @@ -37,7 +39,7 @@ function babel_content() $o .= '

' . L10n::t('Source input: ') . '

' . EOL . EOL; $o .= visible_lf($text) . EOL . EOL; - $html = bbcode($text); + $html = BBCode::convert($text); $o .= '

' . L10n::t("bbcode \x28raw HTML\x28: ") . '

' . EOL . EOL; $o .= htmlspecialchars($html) . EOL . EOL; diff --git a/mod/contacts.php b/mod/contacts.php index 3f7eb342b1..09090e541a 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -6,6 +6,7 @@ use Friendica\App; use Friendica\Content\ContactSelector; use Friendica\Content\Nav; +use Friendica\Content\Text\BBCode; use Friendica\Content\Widget; use Friendica\Core\Addon; use Friendica\Core\L10n; @@ -646,11 +647,11 @@ function contacts_content(App $a) '$profileurllabel' => L10n::t('Profile URL'), '$profileurl' => $contact['url'], '$account_type' => Contact::getAccountType($contact), - '$location' => bbcode($contact["location"]), + '$location' => BBCode::convert($contact["location"]), '$location_label' => L10n::t("Location:"), - '$xmpp' => bbcode($contact["xmpp"]), + '$xmpp' => BBCode::convert($contact["xmpp"]), '$xmpp_label' => L10n::t("XMPP:"), - '$about' => bbcode($contact["about"], false, false), + '$about' => BBCode::convert($contact["about"], false), '$about_label' => L10n::t("About:"), '$keywords' => $contact["keywords"], '$keywords_label' => L10n::t("Tags:"), diff --git a/mod/display.php b/mod/display.php index eb196b0979..1e1515f10f 100644 --- a/mod/display.php +++ b/mod/display.php @@ -4,6 +4,7 @@ */ use Friendica\App; +use Friendica\Content\Text\BBCode; use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\Protocol; @@ -368,8 +369,8 @@ function display_content(App $a, $update = false, $update_uid = 0) { // Preparing the meta header require_once 'include/bbcode.php'; require_once 'include/html2plain.php'; - $description = trim(html2plain(bbcode($s[0]["body"], false, false), 0, true)); - $title = trim(html2plain(bbcode($s[0]["title"], false, false), 0, true)); + $description = trim(html2plain(BBCode::convert($s[0]["body"], false), 0, true)); + $title = trim(html2plain(BBCode::convert($s[0]["title"], false), 0, true)); $author_name = $s[0]["author-name"]; $image = $a->remove_baseurl($s[0]["author-thumb"]); diff --git a/mod/message.php b/mod/message.php index 8940ee44b7..d51fe0a779 100644 --- a/mod/message.php +++ b/mod/message.php @@ -6,6 +6,7 @@ use Friendica\App; use Friendica\Content\Nav; use Friendica\Content\Smilies; +use Friendica\Content\Text\BBCode; use Friendica\Core\L10n; use Friendica\Core\System; use Friendica\Database\DBM; @@ -376,7 +377,7 @@ function message_content(App $a) $from_name_e = $message['from-name']; $subject_e = $message['title']; - $body_e = Smilies::replace(bbcode($message['body'])); + $body_e = Smilies::replace(BBCode::convert($message['body'])); $to_name_e = $message['name']; $contact = Contact::getDetailsByURL($message['from-url']); diff --git a/mod/notify.php b/mod/notify.php index dff7d147f0..a65e14debb 100644 --- a/mod/notify.php +++ b/mod/notify.php @@ -4,6 +4,7 @@ */ use Friendica\App; +use Friendica\Content\Text\BBCode; use Friendica\Core\L10n; use Friendica\Core\NotificationsManager; use Friendica\Core\System; @@ -69,7 +70,7 @@ function notify_content(App $a) $notif_content .= replace_macros($not_tpl, [ '$item_link' => System::baseUrl(true).'/notify/view/'. $it['id'], '$item_image' => $it['photo'], - '$item_text' => strip_tags(bbcode($it['msg'])), + '$item_text' => strip_tags(BBCode::convert($it['msg'])), '$item_when' => Temporal::getRelativeDate($it['date']) ]); } diff --git a/mod/photos.php b/mod/photos.php index 4b031e5b5e..863a848d61 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -6,6 +6,7 @@ use Friendica\App; use Friendica\Content\Feature; use Friendica\Content\Nav; +use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; @@ -17,7 +18,6 @@ use Friendica\Model\Group; use Friendica\Model\Item; use Friendica\Model\Photo; use Friendica\Model\Profile; -use Friendica\Model\Term; use Friendica\Network\Probe; use Friendica\Object\Image; use Friendica\Protocol\DFRN; @@ -1411,7 +1411,7 @@ function photos_content(App $a) if (strlen($tag_str)) { $tag_str .= ', '; } - $tag_str .= bbcode($t); + $tag_str .= BBCode::convert($t); } $tags = [L10n::t('Tags: '), $tag_str]; if ($cmd === 'edit') { @@ -1574,7 +1574,7 @@ function photos_content(App $a) $name_e = $profile_name; $title_e = $item['title']; - $body_e = bbcode($item['body']); + $body_e = BBCode::convert($item['body']); $comments .= replace_macros($template,[ '$id' => $item['item_id'], diff --git a/mod/ping.php b/mod/ping.php index 62ab2644c9..e24168aa97 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -6,6 +6,7 @@ use Friendica\App; use Friendica\Content\Feature; use Friendica\Content\ForumManager; +use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\Cache; use Friendica\Core\L10n; @@ -481,8 +482,8 @@ function ping_get_notifications($uid) $notification["name"] = $notification["name_cache"]; $notification["message"] = $notification["msg_cache"]; } else { - $notification["name"] = strip_tags(bbcode($notification["name"])); - $notification["message"] = format_notification_message($notification["name"], strip_tags(bbcode($notification["msg"]))); + $notification["name"] = strip_tags(BBCode::convert($notification["name"])); + $notification["message"] = format_notification_message($notification["name"], strip_tags(BBCode::convert($notification["msg"]))); q( "UPDATE `notify` SET `name_cache` = '%s', `msg_cache` = '%s' WHERE `id` = %d", diff --git a/mod/poco.php b/mod/poco.php index 639ab8469c..d212bb5f9c 100644 --- a/mod/poco.php +++ b/mod/poco.php @@ -5,6 +5,7 @@ use Friendica\App; +use Friendica\Content\Text\BBCode; use Friendica\Core\Cache; use Friendica\Core\Config; use Friendica\Core\System; @@ -246,7 +247,7 @@ function poco_init(App $a) { $about = Cache::get("about:" . $contact['updated'] . ":" . $contact['nurl']); if (is_null($about)) { require_once 'include/bbcode.php'; - $about = bbcode($contact['about'], false, false); + $about = BBCode::convert($contact['about'], false); Cache::set("about:" . $contact['updated'] . ":" . $contact['nurl'], $about); } diff --git a/mod/register.php b/mod/register.php index 40aa7c1bc4..76c5073d59 100644 --- a/mod/register.php +++ b/mod/register.php @@ -1,9 +1,10 @@ $invite_id, '$realpeople' => $realpeople, '$regtitle' => L10n::t('Registration'), - '$registertext' => x($a->config, 'register_text') ? bbcode($a->config['register_text']) : "", + '$registertext' => x($a->config, 'register_text') ? BBCode::convert($a->config['register_text']) : "", '$fillwith' => $fillwith, '$fillext' => $fillext, '$oidlabel' => $oidlabel, diff --git a/mod/tagrm.php b/mod/tagrm.php index 2a829932ea..b7e72b4da8 100644 --- a/mod/tagrm.php +++ b/mod/tagrm.php @@ -2,7 +2,9 @@ /** * @file mod/tagrm.php */ + use Friendica\App; +use Friendica\Content\Text\BBCode; use Friendica\Core\L10n; use Friendica\Core\System; use Friendica\Database\DBM; @@ -91,7 +93,7 @@ function tagrm_content(App $a) { $o .= '
    '; foreach ($arr as $x) { - $o .= '
  • ' . bbcode($x) . '
  • '; + $o .= '
  • ' . BBCode::convert($x) . '
  • '; } $o .= '
'; diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index a81b69e34b..064d5030ee 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -174,7 +174,7 @@ class BBCode } if ($title != "") { - $title = bbcode(html_entity_decode($title, ENT_QUOTES, 'UTF-8'), false, false, true); + $title = BBCode::convert(html_entity_decode($title, ENT_QUOTES, 'UTF-8'), false, true); $title = html_entity_decode($title, ENT_QUOTES, 'UTF-8'); $title = str_replace(["[", "]"], ["[", "]"], $title); $data["title"] = $title; @@ -409,7 +409,7 @@ class BBCode } } - $html = bbcode($post["text"].$post["after"], false, false, $htmlmode); + $html = BBCode::convert($post["text"].$post["after"], false, $htmlmode); $msg = html2plain($html, 0, true); $msg = trim(html_entity_decode($msg, ENT_QUOTES, 'UTF-8')); @@ -706,7 +706,7 @@ class BBCode } if ($data["description"] != "" && $data["description"] != $data["title"]) { - $return .= sprintf('
%s
', trim(bbcode($data["description"]))); + $return .= sprintf('
%s
', trim(BBCode::convert($data["description"]))); } if ($data["type"] == "link") { diff --git a/src/Core/NotificationsManager.php b/src/Core/NotificationsManager.php index ed12a89141..3d11789e93 100644 --- a/src/Core/NotificationsManager.php +++ b/src/Core/NotificationsManager.php @@ -7,6 +7,7 @@ namespace Friendica\Core; use Friendica\BaseObject; +use Friendica\Content\Text\BBCode; use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Core\System; @@ -46,7 +47,7 @@ class NotificationsManager extends BaseObject $local_time = DateTimeFormat::local($n['date']); $n['timestamp'] = strtotime($local_time); $n['date_rel'] = Temporal::getRelativeDate($n['date']); - $n['msg_html'] = bbcode($n['msg'], false, false, false, false); + $n['msg_html'] = BBCode::convert($n['msg'], false); $n['msg_plain'] = explode("\n", trim(html2plain($n['msg_html'], 0)))[0]; $rets[] = $n; @@ -243,7 +244,7 @@ class NotificationsManager extends BaseObject $default_item_link = System::baseUrl(true) . '/notify/view/' . $it['id']; $default_item_image = proxy_url($it['photo'], false, PROXY_SIZE_MICRO); $default_item_url = $it['url']; - $default_item_text = strip_tags(bbcode($it['msg'])); + $default_item_text = strip_tags(BBCode::convert($it['msg'])); $default_item_when = DateTimeFormat::local($it['date'], 'r'); $default_item_ago = Temporal::getRelativeDate($it['date']); break; @@ -843,8 +844,8 @@ class NotificationsManager extends BaseObject 'contact_id' => $it['contact-id'], 'photo' => ((x($it, 'photo')) ? proxy_url($it['photo'], false, PROXY_SIZE_SMALL) : "images/person-175.jpg"), 'name' => $it['name'], - 'location' => bbcode($it['glocation'], false, false), - 'about' => bbcode($it['gabout'], false, false), + 'location' => BBCode::convert($it['glocation'], false), + 'about' => BBCode::convert($it['gabout'], false), 'keywords' => $it['gkeywords'], 'gender' => $it['ggender'], 'hidden' => $it['hidden'] == 1, diff --git a/src/Model/Profile.php b/src/Model/Profile.php index f31c83c857..d1a705fd7c 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -7,6 +7,7 @@ namespace Friendica\Model; use Friendica\App; use Friendica\Content\Feature; use Friendica\Content\ForumManager; +use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\Cache; use Friendica\Core\Config; @@ -487,13 +488,13 @@ class Profile } if (isset($p['about'])) { - $p['about'] = bbcode($p['about']); + $p['about'] = BBCode::convert($p['about']); } if (isset($p['address'])) { - $p['address'] = bbcode($p['address']); + $p['address'] = BBCode::convert($p['address']); } else { - $p['address'] = bbcode($p['location']); + $p['address'] = BBCode::convert($p['location']); } if (isset($p['photo'])) { @@ -667,13 +668,13 @@ class Profile $istoday = true; } - $title = strip_tags(html_entity_decode(bbcode($rr['summary']), ENT_QUOTES, 'UTF-8')); + $title = strip_tags(html_entity_decode(BBCode::convert($rr['summary']), ENT_QUOTES, 'UTF-8')); if (strlen($title) > 35) { $title = substr($title, 0, 32) . '... '; } - $description = substr(strip_tags(bbcode($rr['desc'])), 0, 32) . '... '; + $description = substr(strip_tags(BBCode::convert($rr['desc'])), 0, 32) . '... '; if (!$description) { $description = L10n::t('[No description]'); } diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index 5fe47ac5fd..00064b7e86 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -832,7 +832,7 @@ class DFRN } } if ($r->content) { - XML::addElement($doc, $entry, "content", bbcode($r->content), ["type" => "html"]); + XML::addElement($doc, $entry, "content", BBCode::convert($r->content), ["type" => "html"]); } return $entry; @@ -938,7 +938,7 @@ class DFRN $htmlbody = "[b]".$item['title']."[/b]\n\n".$htmlbody; } - $htmlbody = bbcode($htmlbody, false, false, 7); + $htmlbody = BBCode::convert($htmlbody, false, 7); } $author = self::addEntryAuthor($doc, "author", $item["author-link"], $item); diff --git a/src/Protocol/Diaspora.php b/src/Protocol/Diaspora.php index 307b52f785..65b84f3cd4 100644 --- a/src/Protocol/Diaspora.php +++ b/src/Protocol/Diaspora.php @@ -9,6 +9,7 @@ */ namespace Friendica\Protocol; +use Friendica\Content\Text\BBCode; use Friendica\Core\Cache; use Friendica\Core\Config; use Friendica\Core\L10n; @@ -4197,7 +4198,7 @@ class Diaspora } $about = $profile['about']; - $about = strip_tags(bbcode($about)); + $about = strip_tags(BBCode::convert($about)); $location = Profile::formatLocation($profile); $tags = ''; diff --git a/src/Protocol/OStatus.php b/src/Protocol/OStatus.php index 7ad6f50f1f..ed3c5c0a07 100644 --- a/src/Protocol/OStatus.php +++ b/src/Protocol/OStatus.php @@ -1373,7 +1373,7 @@ class OStatus XML::addElement($doc, $author, "uri", $owner["url"]); XML::addElement($doc, $author, "name", $owner["nick"]); XML::addElement($doc, $author, "email", $owner["addr"]); - XML::addElement($doc, $author, "summary", bbcode($owner["about"], false, false, 7)); + XML::addElement($doc, $author, "summary", BBCode::convert($owner["about"], false, 7)); $attributes = ["rel" => "alternate", "type" => "text/html", "href" => $owner["url"]]; XML::addElement($doc, $author, "link", "", $attributes); @@ -1398,7 +1398,7 @@ class OStatus XML::addElement($doc, $author, "poco:preferredUsername", $owner["nick"]); XML::addElement($doc, $author, "poco:displayName", $owner["name"]); - XML::addElement($doc, $author, "poco:note", bbcode($owner["about"], false, false, 7)); + XML::addElement($doc, $author, "poco:note", BBCode::convert($owner["about"], false, 7)); if (trim($owner["location"]) != "") { $element = $doc->createElement("poco:address"); @@ -1879,7 +1879,7 @@ class OStatus $body = "[b]".$item['title']."[/b]\n\n".$body; } - $body = bbcode($body, false, false, 7); + $body = BBCode::convert($body, false, 7); XML::addElement($doc, $entry, "content", $body, ["type" => "html"]); From 4e4f5862b2fb63ba7fd521d0a169e22907517d9d Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 14 Feb 2018 21:45:41 -0500 Subject: [PATCH 4/8] Remove unused $preserve_nl parameter from bb2diaspora() --- include/bb2diaspora.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index 7e20037a0b..4f7cce8f5f 100644 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -119,11 +119,10 @@ function diaspora_mentions($match) { * systems like Diaspora and Libertree * * @param string $Text - * @param bool $preserve_nl Effects unclear, unused in Friendica * @param bool $fordiaspora Diaspora requires more changes than Libertree * @return string */ -function bb2diaspora($Text, $preserve_nl = false, $fordiaspora = true) { +function bb2diaspora($Text, $fordiaspora = true) { $a = get_app(); $OriginalText = $Text; From 05a2ea42206aa8ee7fae3ad3566614769ff2e2ee Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 14 Feb 2018 22:00:43 -0500 Subject: [PATCH 5/8] Refactor comments including "bbcode()" --- include/bb2diaspora.php | 2 +- mod/follow.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index 4f7cce8f5f..0a869ab383 100644 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -145,7 +145,7 @@ function bb2diaspora($Text, $fordiaspora = true) { // Converting images with size parameters to simple images. Markdown doesn't know it. $Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", '[img]$3[/img]', $Text); - // Extracting multi-line code blocks before the whitespace processing/code highlighter in bbcode() + // Extracting multi-line code blocks before the whitespace processing/code highlighter in BBCode::convert() $codeblocks = []; $Text = preg_replace_callback("#\[code(?:=([^\]]*))?\](.*?)\[\/code\]#is", diff --git a/mod/follow.php b/mod/follow.php index 83263f4031..bb9bc0eb3b 100644 --- a/mod/follow.php +++ b/mod/follow.php @@ -164,9 +164,9 @@ function follow_content(App $a) { '$url_label' => L10n::t("Profile URL"), '$myaddr' => $myaddr, '$request' => $request, - /*'$location' => bbcode($r[0]["location"]), + /*'$location' => Friendica\Content\Text\BBCode::::convert($r[0]["location"]), '$location_label' => L10n::t("Location:"), - '$about' => bbcode($r[0]["about"], false, false), + '$about' => Friendica\Content\Text\BBCode::::convert($r[0]["about"], false, false), '$about_label' => L10n::t("About:"), */ '$keywords' => $r[0]["keywords"], '$keywords_label' => L10n::t("Tags:") From 9e3bae5caa6725737c2a1221a6c499e06ea0077c Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 14 Feb 2018 22:01:14 -0500 Subject: [PATCH 6/8] Remove references to include/bbcode.php --- include/acl_selectors.php | 3 --- include/api.php | 1 - include/bb2diaspora.php | 1 - include/conversation.php | 2 -- include/enotify.php | 1 - include/event.php | 2 -- include/items.php | 1 - include/text.php | 3 --- mod/babel.php | 2 -- mod/community.php | 1 - mod/display.php | 2 +- mod/events.php | 1 - mod/filer.php | 1 - mod/like.php | 1 - mod/message.php | 2 -- mod/notes.php | 1 - mod/notify.php | 1 - mod/photos.php | 2 -- mod/ping.php | 1 - mod/poco.php | 1 - mod/poke.php | 1 - mod/profile.php | 1 - mod/register.php | 1 - mod/search.php | 1 - mod/subthread.php | 1 - mod/tagger.php | 1 - mod/tagrm.php | 2 -- mod/videos.php | 3 --- src/Content/Text/BBCode.php | 1 - src/Core/NotificationsManager.php | 1 - src/Model/Profile.php | 3 --- src/Protocol/DFRN.php | 1 - src/Protocol/OStatus.php | 1 - src/Worker/Delivery.php | 1 - src/Worker/Notifier.php | 1 - src/Worker/Queue.php | 1 - 36 files changed, 1 insertion(+), 50 deletions(-) diff --git a/include/acl_selectors.php b/include/acl_selectors.php index dd8864a631..e69ac36f68 100644 --- a/include/acl_selectors.php +++ b/include/acl_selectors.php @@ -186,9 +186,6 @@ function contact_selector($selname, $selclass, $options, $preselected = false) function contact_select($selname, $selclass, $preselected = false, $size = 4, $privmail = false, $celeb = false, $privatenet = false, $tabindex = null) { - - require_once "include/bbcode.php"; - $a = get_app(); $o = ''; diff --git a/include/api.php b/include/api.php index 013d47fe23..f7c04aaf88 100644 --- a/include/api.php +++ b/include/api.php @@ -40,7 +40,6 @@ use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; use Friendica\Util\XML; -require_once 'include/bbcode.php'; require_once 'include/conversation.php'; require_once 'include/html2plain.php'; require_once 'mod/share.php'; diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index 0a869ab383..bea15e3d4c 100644 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -12,7 +12,6 @@ use League\HTMLToMarkdown\HtmlConverter; require_once 'include/event.php'; require_once 'include/html2bbcode.php'; -require_once 'include/bbcode.php'; /** * @brief Callback function to replace a Diaspora style mention in a mention for Friendica diff --git a/include/conversation.php b/include/conversation.php index 71770d31d6..1ff1dbf5f4 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -21,7 +21,6 @@ use Friendica\Util\DateTimeFormat; use Friendica\Util\Temporal; use Friendica\Util\XML; -require_once "include/bbcode.php"; require_once "include/acl_selectors.php"; function item_extract_images($body) { @@ -499,7 +498,6 @@ function item_condition() { * */ function conversation(App $a, $items, $mode, $update, $preview = false) { - require_once 'include/bbcode.php'; require_once 'mod/proxy.php'; $ssl_state = ((local_user()) ? true : false); diff --git a/include/enotify.php b/include/enotify.php index 2b6eec576c..c877540aba 100644 --- a/include/enotify.php +++ b/include/enotify.php @@ -12,7 +12,6 @@ use Friendica\Database\DBM; use Friendica\Util\DateTimeFormat; use Friendica\Util\Emailer; -require_once 'include/bbcode.php'; require_once 'include/html2bbcode.php'; /** diff --git a/include/event.php b/include/event.php index c86ba732b8..1c34e03cc6 100644 --- a/include/event.php +++ b/include/event.php @@ -16,7 +16,6 @@ use Friendica\Model\Profile; use Friendica\Util\DateTimeFormat; use Friendica\Util\Map; -require_once 'include/bbcode.php'; require_once 'include/conversation.php'; function format_event_html($ev, $simple = false) { @@ -239,7 +238,6 @@ function event_delete($event_id) { function event_store($arr) { require_once 'include/items.php'; - require_once 'include/bbcode.php'; $a = get_app(); diff --git a/include/items.php b/include/items.php index 456853d80d..31c8aaa799 100644 --- a/include/items.php +++ b/include/items.php @@ -19,7 +19,6 @@ use Friendica\Util\Network; use Friendica\Util\ParseUrl; use Friendica\Util\Temporal; -require_once 'include/bbcode.php'; require_once 'include/text.php'; require_once 'mod/share.php'; require_once 'include/enotify.php'; diff --git a/include/text.php b/include/text.php index ee5d4763ef..02f17fdb4b 100644 --- a/include/text.php +++ b/include/text.php @@ -1424,9 +1424,6 @@ function prepare_body(&$item, $attach = false, $preview = false) { * @return string Formattet HTML. */ function prepare_text($text) { - - require_once 'include/bbcode.php'; - if (stristr($text, '[nosmile]')) { $s = BBCode::convert($text); } else { diff --git a/mod/babel.php b/mod/babel.php index 683bc5fed1..43b5c4e807 100644 --- a/mod/babel.php +++ b/mod/babel.php @@ -7,7 +7,6 @@ use Friendica\Content\Text\BBCode; use Friendica\Content\Text\Markdown; use Friendica\Core\L10n; -require_once 'include/bbcode.php'; require_once 'include/bb2diaspora.php'; require_once 'include/html2bbcode.php'; @@ -43,7 +42,6 @@ function babel_content() $o .= '

' . L10n::t("bbcode \x28raw HTML\x28: ") . '

' . EOL . EOL; $o .= htmlspecialchars($html) . EOL . EOL; - //$html = bbcode($text); $o .= '

' . L10n::t('bbcode: ') . '

' . EOL . EOL; $o .= $html . EOL . EOL; diff --git a/mod/community.php b/mod/community.php index 5536a4934c..88fc6168bb 100644 --- a/mod/community.php +++ b/mod/community.php @@ -63,7 +63,6 @@ function community_content(App $a, $update = 0) } } - require_once 'include/bbcode.php'; require_once 'include/security.php'; require_once 'include/conversation.php'; diff --git a/mod/display.php b/mod/display.php index 1e1515f10f..42aad736cc 100644 --- a/mod/display.php +++ b/mod/display.php @@ -367,8 +367,8 @@ function display_content(App $a, $update = false, $update_uid = 0) { $o .= conversation($a, $items, 'display', $update_uid); // Preparing the meta header - require_once 'include/bbcode.php'; require_once 'include/html2plain.php'; + $description = trim(html2plain(BBCode::convert($s[0]["body"], false), 0, true)); $title = trim(html2plain(BBCode::convert($s[0]["title"], false), 0, true)); $author_name = $s[0]["author-name"]; diff --git a/mod/events.php b/mod/events.php index 5f6fb2c689..695dbb290f 100644 --- a/mod/events.php +++ b/mod/events.php @@ -15,7 +15,6 @@ use Friendica\Model\Profile; use Friendica\Util\DateTimeFormat; use Friendica\Util\Temporal; -require_once 'include/bbcode.php'; require_once 'include/event.php'; require_once 'include/items.php'; diff --git a/mod/filer.php b/mod/filer.php index 177b80acbe..190b6f78ac 100644 --- a/mod/filer.php +++ b/mod/filer.php @@ -7,7 +7,6 @@ use Friendica\Core\L10n; use Friendica\Core\PConfig; require_once 'include/security.php'; -require_once 'include/bbcode.php'; require_once 'include/items.php'; function filer_content(App $a) diff --git a/mod/like.php b/mod/like.php index 9371c30743..957fe5fc42 100644 --- a/mod/like.php +++ b/mod/like.php @@ -5,7 +5,6 @@ use Friendica\Core\System; use Friendica\Model\Item; require_once 'include/security.php'; -require_once 'include/bbcode.php'; require_once 'include/items.php'; function like_content(App $a) { diff --git a/mod/message.php b/mod/message.php index d51fe0a779..bb32b5a72d 100644 --- a/mod/message.php +++ b/mod/message.php @@ -336,8 +336,6 @@ function message_content(App $a) intval(local_user()) ); - require_once("include/bbcode.php"); - $tpl = get_markup_template('msg-header.tpl'); $a->page['htmlhead'] .= replace_macros($tpl, [ '$baseurl' => System::baseUrl(true), diff --git a/mod/notes.php b/mod/notes.php index b607c084ed..3b46df07da 100644 --- a/mod/notes.php +++ b/mod/notes.php @@ -31,7 +31,6 @@ function notes_content(App $a, $update = false) return; } - require_once 'include/bbcode.php'; require_once 'include/security.php'; require_once 'include/conversation.php'; require_once 'include/acl_selectors.php'; diff --git a/mod/notify.php b/mod/notify.php index a65e14debb..f22c1cf5b1 100644 --- a/mod/notify.php +++ b/mod/notify.php @@ -62,7 +62,6 @@ function notify_content(App $a) $notif_tpl = get_markup_template('notifications.tpl'); $not_tpl = get_markup_template('notify.tpl'); - require_once('include/bbcode.php'); $r = $nm->getAll(['seen'=>0]); if (DBM::is_result($r) > 0) { diff --git a/mod/photos.php b/mod/photos.php index 863a848d61..2b6998ae1d 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -27,7 +27,6 @@ use Friendica\Util\Temporal; require_once 'include/items.php'; require_once 'include/acl_selectors.php'; -require_once 'include/bbcode.php'; require_once 'include/security.php'; function photos_init(App $a) { @@ -934,7 +933,6 @@ function photos_content(App $a) return; } - require_once 'include/bbcode.php'; require_once 'include/security.php'; require_once 'include/conversation.php'; diff --git a/mod/ping.php b/mod/ping.php index e24168aa97..146411206f 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -19,7 +19,6 @@ use Friendica\Util\DateTimeFormat; use Friendica\Util\Temporal; use Friendica\Util\XML; -require_once 'include/bbcode.php'; require_once 'mod/proxy.php'; require_once 'include/enotify.php'; diff --git a/mod/poco.php b/mod/poco.php index d212bb5f9c..0728020ecc 100644 --- a/mod/poco.php +++ b/mod/poco.php @@ -246,7 +246,6 @@ function poco_init(App $a) { } $about = Cache::get("about:" . $contact['updated'] . ":" . $contact['nurl']); if (is_null($about)) { - require_once 'include/bbcode.php'; $about = BBCode::convert($contact['about'], false); Cache::set("about:" . $contact['updated'] . ":" . $contact['nurl'], $about); } diff --git a/mod/poke.php b/mod/poke.php index c120791739..3148896bc2 100644 --- a/mod/poke.php +++ b/mod/poke.php @@ -22,7 +22,6 @@ use Friendica\Database\DBM; use Friendica\Model\Item; require_once 'include/security.php'; -require_once 'include/bbcode.php'; require_once 'include/items.php'; function poke_init(App $a) { diff --git a/mod/profile.php b/mod/profile.php index a7c39ab33f..74ca06aad9 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -116,7 +116,6 @@ function profile_content(App $a, $update = 0) return Login::form(); } - require_once 'include/bbcode.php'; require_once 'include/security.php'; require_once 'include/conversation.php'; require_once 'include/acl_selectors.php'; diff --git a/mod/register.php b/mod/register.php index 76c5073d59..51ed57a9c5 100644 --- a/mod/register.php +++ b/mod/register.php @@ -15,7 +15,6 @@ use Friendica\Model\User; use Friendica\Util\DateTimeFormat; require_once 'include/enotify.php'; -require_once 'include/bbcode.php'; function register_post(App $a) { diff --git a/mod/search.php b/mod/search.php index afe94121db..1f93934658 100644 --- a/mod/search.php +++ b/mod/search.php @@ -11,7 +11,6 @@ use Friendica\Core\L10n; use Friendica\Core\System; use Friendica\Database\DBM; -require_once "include/bbcode.php"; require_once 'include/security.php'; require_once 'include/conversation.php'; require_once 'mod/dirfind.php'; diff --git a/mod/subthread.php b/mod/subthread.php index b4f2ca819c..c858f2d1fa 100644 --- a/mod/subthread.php +++ b/mod/subthread.php @@ -10,7 +10,6 @@ use Friendica\Database\DBM; use Friendica\Model\Item; require_once 'include/security.php'; -require_once 'include/bbcode.php'; require_once 'include/items.php'; function subthread_content(App $a) { diff --git a/mod/tagger.php b/mod/tagger.php index c602613f1f..16195cc339 100644 --- a/mod/tagger.php +++ b/mod/tagger.php @@ -11,7 +11,6 @@ use Friendica\Database\DBM; use Friendica\Model\Item; require_once 'include/security.php'; -require_once 'include/bbcode.php'; require_once 'include/items.php'; function tagger_content(App $a) { diff --git a/mod/tagrm.php b/mod/tagrm.php index b7e72b4da8..b9991d68da 100644 --- a/mod/tagrm.php +++ b/mod/tagrm.php @@ -10,8 +10,6 @@ use Friendica\Core\System; use Friendica\Database\DBM; use Friendica\Model\Item; -require_once 'include/bbcode.php'; - function tagrm_post(App $a) { if (!local_user()) { diff --git a/mod/videos.php b/mod/videos.php index 65dda1b498..75a4d031f3 100644 --- a/mod/videos.php +++ b/mod/videos.php @@ -20,7 +20,6 @@ use Friendica\Util\DateTimeFormat; require_once 'include/items.php'; require_once 'include/acl_selectors.php'; -require_once 'include/bbcode.php'; require_once 'include/security.php'; function videos_init(App $a) { @@ -202,8 +201,6 @@ function videos_content(App $a) { return; } - - require_once('include/bbcode.php'); require_once('include/security.php'); require_once('include/conversation.php'); diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index 064d5030ee..9f250e9bfa 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -23,7 +23,6 @@ use Friendica\Util\Map; use Friendica\Util\Network; use Friendica\Util\ParseUrl; -require_once "include/bbcode.php"; require_once "include/event.php"; require_once "include/html2plain.php"; require_once "mod/proxy.php"; diff --git a/src/Core/NotificationsManager.php b/src/Core/NotificationsManager.php index 3d11789e93..0e552d2e09 100644 --- a/src/Core/NotificationsManager.php +++ b/src/Core/NotificationsManager.php @@ -20,7 +20,6 @@ use Friendica\Util\XML; require_once 'include/dba.php'; require_once 'include/html2plain.php'; -require_once 'include/bbcode.php'; /** * @brief Methods for read and write notifications from/to database diff --git a/src/Model/Profile.php b/src/Model/Profile.php index d1a705fd7c..81f9963099 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -24,7 +24,6 @@ use Friendica\Util\Temporal; use dba; require_once 'include/dba.php'; -require_once 'include/bbcode.php'; require_once 'mod/proxy.php'; class Profile @@ -625,8 +624,6 @@ class Profile public static function getEvents() { - require_once 'include/bbcode.php'; - $a = get_app(); $o = ''; diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index 00064b7e86..6876d25418 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -43,7 +43,6 @@ require_once "include/items.php"; require_once "include/event.php"; require_once "include/text.php"; require_once "include/html2bbcode.php"; -require_once "include/bbcode.php"; /** * @brief This class contain functions to create and send DFRN XML files diff --git a/src/Protocol/OStatus.php b/src/Protocol/OStatus.php index ed3c5c0a07..7b06a2d68b 100644 --- a/src/Protocol/OStatus.php +++ b/src/Protocol/OStatus.php @@ -26,7 +26,6 @@ use DOMXPath; require_once 'include/dba.php'; require_once 'include/html2bbcode.php'; -require_once 'include/bbcode.php'; require_once 'include/items.php'; require_once 'mod/share.php'; require_once 'include/enotify.php'; diff --git a/src/Worker/Delivery.php b/src/Worker/Delivery.php index dbc0bdb5d0..b8eceb05bc 100644 --- a/src/Worker/Delivery.php +++ b/src/Worker/Delivery.php @@ -19,7 +19,6 @@ use dba; require_once 'include/html2plain.php'; require_once 'include/items.php'; -require_once 'include/bbcode.php'; /// @todo This is some ugly code that needs to be split into several methods diff --git a/src/Worker/Notifier.php b/src/Worker/Notifier.php index f22549c2b8..b43639b845 100644 --- a/src/Worker/Notifier.php +++ b/src/Worker/Notifier.php @@ -20,7 +20,6 @@ use dba; require_once 'include/dba.php'; require_once 'include/html2plain.php'; require_once 'include/items.php'; -require_once 'include/bbcode.php'; /* * This file was at one time responsible for doing all deliveries, but this caused diff --git a/src/Worker/Queue.php b/src/Worker/Queue.php index 29be22199f..3f4a764cee 100644 --- a/src/Worker/Queue.php +++ b/src/Worker/Queue.php @@ -18,7 +18,6 @@ use dba; require_once 'include/dba.php'; require_once 'include/items.php'; -require_once 'include/bbcode.php'; class Queue { From 71cb1523d5b0ed67fbf9917b267aaad287120265 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 14 Feb 2018 22:05:16 -0500 Subject: [PATCH 7/8] Remove include/bbcode.php --- include/bbcode.php | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 include/bbcode.php diff --git a/include/bbcode.php b/include/bbcode.php deleted file mode 100644 index 0bda691acc..0000000000 --- a/include/bbcode.php +++ /dev/null @@ -1,11 +0,0 @@ - Date: Thu, 15 Feb 2018 15:10:00 -0500 Subject: [PATCH 8/8] Remove IDE quirk in mod/register --- mod/register.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/register.php b/mod/register.php index 51ed57a9c5..adbac0708c 100644 --- a/mod/register.php +++ b/mod/register.php @@ -1,6 +1,6 @@