From 10086f940dad9b11da26a097fa264a7b439ac9c0 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 12 Aug 2018 07:52:21 +0200 Subject: [PATCH] And again removed notices (#700) * And again removed notices * Sometimes there doesn't seem to be a content, then we don't continue --- pumpio/pumpio.php | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index d68c1071..48765ffd 100644 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.php @@ -361,18 +361,19 @@ function pumpio_settings_post(App $a, array &$b) $host = trim($host); $host = str_replace(["https://", "http://"], ["", ""], $host); - PConfig::set(local_user(), 'pumpio', 'post' , intval($_POST['pumpio'])); - PConfig::set(local_user(), 'pumpio', 'import' , $_POST['pumpio_import']); - PConfig::set(local_user(), 'pumpio', 'host' , $host); - PConfig::set(local_user(), 'pumpio', 'user' , $user); - PConfig::set(local_user(), 'pumpio', 'public' , $_POST['pumpio_public']); - PConfig::set(local_user(), 'pumpio', 'mirror' , $_POST['pumpio_mirror']); - PConfig::set(local_user(), 'pumpio', 'post_by_default', intval($_POST['pumpio_bydefault'])); - - if (!$_POST['pumpio_mirror']) { - PConfig::delete(local_user(), 'pumpio', 'lastdate'); + if (isset($_POST['pumpio'])) { + PConfig::set(local_user(), 'pumpio', 'post' , intval($_POST['pumpio'])); + PConfig::set(local_user(), 'pumpio', 'import' , $_POST['pumpio_import']); + PConfig::set(local_user(), 'pumpio', 'host' , $host); + PConfig::set(local_user(), 'pumpio', 'user' , $user); + PConfig::set(local_user(), 'pumpio', 'public' , $_POST['pumpio_public']); + PConfig::set(local_user(), 'pumpio', 'mirror' , $_POST['pumpio_mirror']); + PConfig::set(local_user(), 'pumpio', 'post_by_default', intval($_POST['pumpio_bydefault'])); + + if (!$_POST['pumpio_mirror']) { + PConfig::delete(local_user(), 'pumpio', 'lastdate'); + } } - //header("Location: ".$a->get_baseurl()."/pumpio/connect"); } } @@ -1219,6 +1220,11 @@ function pumpio_dopost(App $a, $client, $uid, $self, $post, $own_id, $threadcomp $postarray['parent-uri'] = $post->object->inReplyTo->id; } + // When there is no content there is no need to continue + if (empty($post->object->content)) { + return false; + } + if (!empty($post->object->pump_io->proxyURL)) { $postarray['extid'] = $post->object->pump_io->proxyURL; } -- 2.39.5