]> git.mxchange.org Git - friendica-addons.git/commitdiff
And again removed notices (#700)
authorMichael Vogel <icarus@dabo.de>
Sun, 12 Aug 2018 05:52:21 +0000 (07:52 +0200)
committerTobias Diekershoff <tobias.diekershoff@gmx.net>
Sun, 12 Aug 2018 05:52:21 +0000 (07:52 +0200)
* And again removed notices

* Sometimes there doesn't seem to be a content, then we don't continue

pumpio/pumpio.php

index d68c107156e7af1f862545161ef3ec43a1ca2af6..48765ffd78d7f44d4fe4fc4c94da65a1803b5f05 100644 (file)
@@ -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;
        }