From 86077da8e5029bab493115b07bb2559ff253c603 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 11 Aug 2018 11:37:13 +0000 Subject: [PATCH 1/2] And again removed notices --- pumpio/pumpio.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index 3bc03efa..f2fe7d85 100644 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.php @@ -360,18 +360,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 (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'); + if (!$_POST['pumpio_mirror']) { + PConfig::delete(local_user(), 'pumpio', 'lastdate'); + } } - //header("Location: ".$a->get_baseurl()."/pumpio/connect"); } } -- 2.45.2 From 3a568a36476eaba49f4610b1c81642fb9a3ff4b5 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 11 Aug 2018 18:05:06 +0000 Subject: [PATCH 2/2] Sometimes there doesn't seem to be a content, then we don't continue --- pumpio/pumpio.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php index f2fe7d85..b60b0c97 100644 --- a/pumpio/pumpio.php +++ b/pumpio/pumpio.php @@ -1219,6 +1219,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.45.2