From ba96796363ad6777269a966774542b1ea5dcb352 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Thu, 4 Jan 2018 12:15:53 -0500 Subject: [PATCH] Fix unused code in buffer, statusnet and twitter - Remove unused argument in plaintext() --- buffer/buffer.php | 9 +++++---- statusnet/statusnet.php | 4 ++-- twitter/twitter.php | 6 +++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/buffer/buffer.php b/buffer/buffer.php index 131574819..97373f301 100644 --- a/buffer/buffer.php +++ b/buffer/buffer.php @@ -5,8 +5,9 @@ * Version: 0.2 * Author: Michael Vogel */ -require('addon/buffer/bufferapp.php'); +require 'addon/buffer/bufferapp.php'; +use Friendica\App; use Friendica\Core\Config; use Friendica\Core\PConfig; @@ -236,8 +237,8 @@ function buffer_post_local(&$a,&$b) { $b['postopts'] .= 'buffer'; } -function buffer_send(&$a,&$b) { - +function buffer_send(App $a, &$b) +{ if($b['deleted'] || $b['private'] || ($b['created'] !== $b['edited'])) return; @@ -331,7 +332,7 @@ function buffer_send(&$a,&$b) { $item["body"] = preg_replace("(\[s\](.*?)\[\/s\])ism",'-$1-',$item["body"]); } - $post = plaintext($a, $item, $limit, $includedlinks, $htmlmode); + $post = plaintext($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 6c76c48cb..1a8766a33 100644 --- a/statusnet/statusnet.php +++ b/statusnet/statusnet.php @@ -637,7 +637,7 @@ function statusnet_post_hook(App $a, &$b) $tempfile = ""; require_once "include/plaintext.php"; require_once "include/network.php"; - $msgarr = plaintext($a, $b, $max_char, true, 7); + $msgarr = plaintext($b, $max_char, true, 7); $msg = $msgarr["text"]; if (($msg == "") && isset($msgarr["title"])) @@ -806,7 +806,7 @@ function statusnet_prepare_body(App $a, &$b) } } - $msgarr = plaintext($a, $item, $max_char, true, 7); + $msgarr = plaintext($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 ca5da52ff..6d0dddd9a 100644 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -523,7 +523,7 @@ function twitter_post_hook(App $a, &$b) $max_char = 280; require_once "include/plaintext.php"; - $msgarr = plaintext($a, $b, $max_char, true, 8); + $msgarr = plaintext($b, $max_char, true, 8); $msg = $msgarr["text"]; if (($msg == "") && isset($msgarr["title"])) { @@ -592,7 +592,7 @@ function twitter_post_hook(App $a, &$b) // ----------------- $max_char = 280; require_once "include/plaintext.php"; - $msgarr = plaintext($a, $b, $max_char, true, 8); + $msgarr = plaintext($b, $max_char, true, 8); $msg = $msgarr["text"]; if (($msg == "") && isset($msgarr["title"])) { @@ -789,7 +789,7 @@ function twitter_prepare_body(App $a, &$b) } } - $msgarr = plaintext($a, $item, $max_char, true, 8); + $msgarr = plaintext($item, $max_char, true, 8); $msg = $msgarr["text"]; if (isset($msgarr["url"]) && ($msgarr["type"] != "photo")) {