From 979f12e51e0f7291298c02b6f5572737e2139869 Mon Sep 17 00:00:00 2001 From: Philipp Holzer Date: Tue, 26 Feb 2019 15:47:17 +0100 Subject: [PATCH] [pageheader] Avoid notice --- irc/irc.php | 6 +++--- pageheader/pageheader.php | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/irc/irc.php b/irc/irc.php index b8c0847b7..aa727e2ee 100644 --- a/irc/irc.php +++ b/irc/irc.php @@ -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 */ diff --git a/pageheader/pageheader.php b/pageheader/pageheader.php index 2ec925094..473c5e66c 100644 --- a/pageheader/pageheader.php +++ b/pageheader/pageheader.php @@ -7,7 +7,7 @@ * Hauke Altmann * */ -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); } }