Merge pull request #678 from annando/notices

And now for something complete different ... notices
This commit is contained in:
Tobias Diekershoff 2018-07-31 18:41:09 +02:00 committed by GitHub
commit c0ecafcfdc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 9 deletions

View file

@ -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); $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; $dw_enable = 1;
} }

View file

@ -229,7 +229,9 @@ function fromgplus_parse_query($var)
foreach($var as $val) { foreach($var as $val) {
$x = explode('=', $val); $x = explode('=', $val);
$arr[$x[0]] = $x[1]; if (count($x) > 1) {
$arr[$x[0]] = $x[1];
}
} }
unset($val, $x, $var); unset($val, $x, $var);
return $arr; return $arr;
@ -249,7 +251,7 @@ function fromgplus_cleanupgoogleproxy($fullImage, $image) {
$cleaned = []; $cleaned = [];
$queryvar = fromgplus_parse_query($fullImage); $queryvar = fromgplus_parse_query($fullImage);
if ($queryvar['url'] != "") if (!empty($queryvar['url']))
$cleaned["full"] = urldecode($queryvar['url']); $cleaned["full"] = urldecode($queryvar['url']);
else else
$cleaned["full"] = $fullImage; $cleaned["full"] = $fullImage;
@ -257,24 +259,24 @@ function fromgplus_cleanupgoogleproxy($fullImage, $image) {
$cleaned["full"] = ""; $cleaned["full"] = "";
$queryvar = fromgplus_parse_query($image); $queryvar = fromgplus_parse_query($image);
if ($queryvar['url'] != "") if (!empty($queryvar['url']))
$cleaned["preview"] = urldecode($queryvar['url']); $cleaned["preview"] = urldecode($queryvar['url']);
else else
$cleaned["preview"] = $image; $cleaned["preview"] = $image;
if (@exif_imagetype($cleaned["preview"]) == 0) if (@exif_imagetype($cleaned["preview"]) == 0)
$cleaned["preview"] = ""; $cleaned["preview"] = "";
if ($cleaned["full"] == "") { if (empty($cleaned["full"])) {
$cleaned["full"] = $cleaned["preview"]; $cleaned["full"] = $cleaned["preview"];
$cleaned["preview"] = ""; $cleaned["preview"] = "";
} }
if ($cleaned["full"] != "") if (!empty($cleaned["full"]))
$infoFull = Image::getInfoFromURL($cleaned["full"]); $infoFull = Image::getInfoFromURL($cleaned["full"]);
else else
$infoFull = ["0" => 0, "1" => 0]; $infoFull = ["0" => 0, "1" => 0];
if ($cleaned["preview"] != "") if (!empty($cleaned["preview"]))
$infoPreview = Image::getInfoFromURL($cleaned["preview"]); $infoPreview = Image::getInfoFromURL($cleaned["preview"]);
else else
$infoFull = ["0" => 0, "1" => 0]; $infoFull = ["0" => 0, "1" => 0];

View file

@ -131,7 +131,7 @@ function ljpost_post_local(&$a,&$b) {
$lj_enable = (($lj_post && x($_REQUEST,'ljpost_enable')) ? intval($_REQUEST['ljpost_enable']) : 0); $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; $lj_enable = 1;
if(! $lj_enable) if(! $lj_enable)

View file

@ -1229,6 +1229,7 @@ function pumpio_dopost(App $a, $client, $uid, $self, $post, $own_id, $threadcomp
$postarray['author-avatar'] = $post->actor->image->url; $postarray['author-avatar'] = $post->actor->image->url;
$postarray['plink'] = $post->object->url; $postarray['plink'] = $post->object->url;
$postarray['app'] = $post->generator->displayName; $postarray['app'] = $post->generator->displayName;
$postarray['title'] = '';
$postarray['body'] = HTML::toBBCode($post->object->content); $postarray['body'] = HTML::toBBCode($post->object->content);
$postarray['object'] = json_encode($post); $postarray['object'] = json_encode($post);

View file

@ -585,7 +585,7 @@ function statusnet_post_hook(App $a, &$b)
$result = $cb->statuses_update($postdata); $result = $cb->statuses_update($postdata);
//$result = $dent->post('statuses/update', $postdata); //$result = $dent->post('statuses/update', $postdata);
logger('statusnet_post send, result: ' . print_r($result, true) . 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)) { if (!empty($result->source)) {
PConfig::set($b["uid"], "statusnet", "application_name", strip_tags($result->source)); PConfig::set($b["uid"], "statusnet", "application_name", strip_tags($result->source));