From 7f02ca32c90e36b1f001a6616e851658d1f66e4d Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 31 Jul 2018 16:22:05 +0000 Subject: [PATCH] And now for something complete different ... notices --- dwpost/dwpost.php | 2 +- fromgplus/fromgplus.php | 14 ++++++++------ ljpost/ljpost.php | 2 +- pumpio/pumpio.php | 1 + statusnet/statusnet.php | 2 +- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/dwpost/dwpost.php b/dwpost/dwpost.php index 9afbcc83..0174bf10 100644 --- a/dwpost/dwpost.php +++ b/dwpost/dwpost.php @@ -137,7 +137,7 @@ function dwpost_post_local(App $a, array &$b) $dw_enable = (($dw_post && x($_REQUEST,'dwpost_enable')) ? intval($_REQUEST['dwpost_enable']) : 0); - if ($_REQUEST['api_source'] && intval(PConfig::get(local_user(),'dwpost','post_by_default'))) { + if ($b['api_source'] && intval(PConfig::get(local_user(),'dwpost','post_by_default'))) { $dw_enable = 1; } diff --git a/fromgplus/fromgplus.php b/fromgplus/fromgplus.php index 78cbc83d..9c8c7ff2 100644 --- a/fromgplus/fromgplus.php +++ b/fromgplus/fromgplus.php @@ -229,7 +229,9 @@ function fromgplus_parse_query($var) foreach($var as $val) { $x = explode('=', $val); - $arr[$x[0]] = $x[1]; + if (count($x) > 1) { + $arr[$x[0]] = $x[1]; + } } unset($val, $x, $var); return $arr; @@ -249,7 +251,7 @@ function fromgplus_cleanupgoogleproxy($fullImage, $image) { $cleaned = []; $queryvar = fromgplus_parse_query($fullImage); - if ($queryvar['url'] != "") + if (!empty($queryvar['url'])) $cleaned["full"] = urldecode($queryvar['url']); else $cleaned["full"] = $fullImage; @@ -257,24 +259,24 @@ function fromgplus_cleanupgoogleproxy($fullImage, $image) { $cleaned["full"] = ""; $queryvar = fromgplus_parse_query($image); - if ($queryvar['url'] != "") + if (!empty($queryvar['url'])) $cleaned["preview"] = urldecode($queryvar['url']); else $cleaned["preview"] = $image; if (@exif_imagetype($cleaned["preview"]) == 0) $cleaned["preview"] = ""; - if ($cleaned["full"] == "") { + if (empty($cleaned["full"])) { $cleaned["full"] = $cleaned["preview"]; $cleaned["preview"] = ""; } - if ($cleaned["full"] != "") + if (!empty($cleaned["full"])) $infoFull = Image::getInfoFromURL($cleaned["full"]); else $infoFull = ["0" => 0, "1" => 0]; - if ($cleaned["preview"] != "") + if (!empty($cleaned["preview"])) $infoPreview = Image::getInfoFromURL($cleaned["preview"]); else $infoFull = ["0" => 0, "1" => 0]; diff --git a/ljpost/ljpost.php b/ljpost/ljpost.php index ec99f9ba..669788fd 100644 --- a/ljpost/ljpost.php +++ b/ljpost/ljpost.php @@ -131,7 +131,7 @@ function ljpost_post_local(&$a,&$b) { $lj_enable = (($lj_post && x($_REQUEST,'ljpost_enable')) ? intval($_REQUEST['ljpost_enable']) : 0); - if($_REQUEST['api_source'] && intval(PConfig::get(local_user(),'ljpost','post_by_default'))) + if($b['api_source'] && intval(PConfig::get(local_user(),'ljpost','post_by_default'))) $lj_enable = 1; if(! $lj_enable) diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index 40c653d8..ce82ca31 100644 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.php @@ -1229,6 +1229,7 @@ function pumpio_dopost(App $a, $client, $uid, $self, $post, $own_id, $threadcomp $postarray['author-avatar'] = $post->actor->image->url; $postarray['plink'] = $post->object->url; $postarray['app'] = $post->generator->displayName; + $postarray['title'] = ''; $postarray['body'] = HTML::toBBCode($post->object->content); $postarray['object'] = json_encode($post); diff --git a/statusnet/statusnet.php b/statusnet/statusnet.php index 6f987f36..92dadc4c 100644 --- a/statusnet/statusnet.php +++ b/statusnet/statusnet.php @@ -585,7 +585,7 @@ function statusnet_post_hook(App $a, &$b) $result = $cb->statuses_update($postdata); //$result = $dent->post('statuses/update', $postdata); logger('statusnet_post send, result: ' . print_r($result, true) . - "\nmessage: " . $msg, LOGGER_DEBUG . "\nOriginal post: " . print_r($b, true) . "\nPost Data: " . print_r($postdata, true)); + "\nmessage: " . $msg . "\nOriginal post: " . print_r($b, true) . "\nPost Data: " . print_r($postdata, true), LOGGER_DEBUG); if (!empty($result->source)) { PConfig::set($b["uid"], "statusnet", "application_name", strip_tags($result->source));