]> git.mxchange.org Git - friendica-addons.git/commitdiff
[pageheader] Avoid notice
authorPhilipp Holzer <admin@philipp.info>
Tue, 26 Feb 2019 14:47:17 +0000 (15:47 +0100)
committerPhilipp Holzer <admin@philipp.info>
Tue, 26 Feb 2019 14:47:17 +0000 (15:47 +0100)
irc/irc.php
pageheader/pageheader.php

index b8c0847b7c0c60e0727a30093987fd862c1a48af..aa727e2eeccf7645f8c00d852b0557682427b52b 100644 (file)
@@ -56,11 +56,11 @@ function irc_addon_settings_post(&$a, &$b) {
        if(!local_user())
                return;
 
-       if(!empty($_POST['irc-submit']) &&  $_POST['irc-submit']) {
-               if (!isset($_POST['autochans'])) {
+       if(!empty($_POST['irc-submit'])) {
+               if (isset($_POST['autochans'])) {
                        PConfig::set(local_user(), 'irc', 'autochans', trim(($_POST['autochans'])));
                }
-               if (!isset($_POST['sitechats'])) {
+               if (isset($_POST['sitechats'])) {
                        PConfig::set(local_user(), 'irc', 'sitechats', trim($_POST['sitechats']));
                }
                /* upid pop-up thing */
index 2ec925094731c7992d7d7bcd5bc4359fd151ec3b..473c5e66c5e89964a23f88a7c8b66375b9779c61 100644 (file)
@@ -7,7 +7,7 @@
  *         Hauke Altmann <https://snarl.de/profile/tugelblend>
  * 
  */
-use Friendica\Core\Addon;
+
 use Friendica\Core\Config;
 use Friendica\Core\Hook;
 use Friendica\Core\L10n;
@@ -66,8 +66,10 @@ function pageheader_addon_settings_post(&$a,&$b) {
        if(! is_site_admin())
                return;
 
-       if($_POST['pageheader-submit']) {
-               Config::set('pageheader','text',trim(strip_tags($_POST['pageheader-words'])));
+       if(!empty($_POST['pageheader-submit'])) {
+               if (isset($_POST['pageheader-words'])) {
+                       Config::set('pageheader', 'text', trim(strip_tags($_POST['pageheader-words'])));
+               }
                info(L10n::t('pageheader Settings saved.') . EOL);
        }
 }