From: Philipp Holzer Date: Tue, 26 Feb 2019 14:44:29 +0000 (+0100) Subject: [irc] fixed index error X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f91b114ba7f8b6dc83639a19e50e35761900a549;p=friendica-addons.git [irc] fixed index error --- diff --git a/irc/irc.php b/irc/irc.php index eab755c8..b8c0847b 100644 --- a/irc/irc.php +++ b/irc/irc.php @@ -6,6 +6,7 @@ * Author: tony baldwin * Author: Tobias Diekershoff */ + 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); }