]> git.mxchange.org Git - friendica-addons.git/commitdiff
[irc] fixed index error
authorPhilipp Holzer <admin@philipp.info>
Tue, 26 Feb 2019 14:44:29 +0000 (15:44 +0100)
committerPhilipp Holzer <admin@philipp.info>
Tue, 26 Feb 2019 14:44:29 +0000 (15:44 +0100)
irc/irc.php

index eab755c8ee5fbdc2b35e64a4fd79d2a35f7fc627..b8c0847b7c0c60e0727a30093987fd862c1a48af 100644 (file)
@@ -6,6 +6,7 @@
 * Author: tony baldwin <https://free-haven.org/profile/tony>
 * Author: Tobias Diekershoff <https://f.diekershoff.de/u/tobias>
 */
+
 use Friendica\Core\Config;
 use Friendica\Core\Hook;
 use Friendica\Core\L10n;
@@ -51,13 +52,17 @@ function irc_addon_settings(&$a,&$s) {
 
 }
 
-function irc_addon_settings_post(&$a,&$b) {
-       if(! local_user())
+function irc_addon_settings_post(&$a, &$b) {
+       if(!local_user())
                return;
 
-       if($_POST['irc-submit']) {
-               PConfig::set( local_user(), 'irc','autochans',trim($_POST['autochans']));
-               PConfig::set( local_user(), 'irc','sitechats',trim($_POST['sitechats']));
+       if(!empty($_POST['irc-submit']) &&  $_POST['irc-submit']) {
+               if (!isset($_POST['autochans'])) {
+                       PConfig::set(local_user(), 'irc', 'autochans', trim(($_POST['autochans'])));
+               }
+               if (!isset($_POST['sitechats'])) {
+                       PConfig::set(local_user(), 'irc', 'sitechats', trim($_POST['sitechats']));
+               }
                /* upid pop-up thing */
                info(L10n::t('IRC settings saved.') . EOL);
        }