Skip to content

Commit

Permalink
Merge pull request #483 from MrPetovan/task/fix-scrutinizer-issues
Browse files Browse the repository at this point in the history
Fix unused code in buffer, statusnet and twitter
  • Loading branch information
annando committed Jan 4, 2018
2 parents 7dcfa83 + ba96796 commit 007cbc8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
9 changes: 5 additions & 4 deletions buffer/buffer.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
* Version: 0.2
* Author: Michael Vogel <https://pirati.ca/profile/heluecht>
*/
require('addon/buffer/bufferapp.php');
require 'addon/buffer/bufferapp.php';

use Friendica\App;
use Friendica\Core\Config;
use Friendica\Core\PConfig;

Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions statusnet/statusnet.php
Original file line number Diff line number Diff line change
Expand Up @@ -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"]))
Expand Down Expand Up @@ -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")) {
Expand Down
6 changes: 3 additions & 3 deletions twitter/twitter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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"])) {
Expand Down Expand Up @@ -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"])) {
Expand Down Expand Up @@ -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")) {
Expand Down

0 comments on commit 007cbc8

Please sign in to comment.