[irc] fixed index error

This commit is contained in:
Philipp Holzer 2019-02-26 15:44:29 +01:00
parent 59fe5be987
commit f91b114ba7
No known key found for this signature in database
GPG key ID: 517BE60E2CE5C8A5

View 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;
@ -55,9 +56,13 @@ function irc_addon_settings_post(&$a,&$b) {
if(!local_user())
return;
if($_POST['irc-submit']) {
PConfig::set( local_user(), 'irc','autochans',trim($_POST['autochans']));
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);
}