[pageheader] Avoid notice

pull/816/head
Philipp Holzer 2019-02-26 15:47:17 +01:00
parent f91b114ba7
commit 979f12e51e
No known key found for this signature in database
GPG Key ID: 517BE60E2CE5C8A5
2 changed files with 8 additions and 6 deletions

View File

@ -56,11 +56,11 @@ function irc_addon_settings_post(&$a, &$b) {
if(!local_user()) if(!local_user())
return; return;
if(!empty($_POST['irc-submit']) && $_POST['irc-submit']) { if(!empty($_POST['irc-submit'])) {
if (!isset($_POST['autochans'])) { if (isset($_POST['autochans'])) {
PConfig::set(local_user(), 'irc', 'autochans', trim(($_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'])); PConfig::set(local_user(), 'irc', 'sitechats', trim($_POST['sitechats']));
} }
/* upid pop-up thing */ /* upid pop-up thing */

View File

@ -7,7 +7,7 @@
* Hauke Altmann <https://snarl.de/profile/tugelblend> * Hauke Altmann <https://snarl.de/profile/tugelblend>
* *
*/ */
use Friendica\Core\Addon;
use Friendica\Core\Config; use Friendica\Core\Config;
use Friendica\Core\Hook; use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
@ -66,8 +66,10 @@ function pageheader_addon_settings_post(&$a,&$b) {
if(! is_site_admin()) if(! is_site_admin())
return; return;
if($_POST['pageheader-submit']) { if(!empty($_POST['pageheader-submit'])) {
Config::set('pageheader','text',trim(strip_tags($_POST['pageheader-words']))); if (isset($_POST['pageheader-words'])) {
Config::set('pageheader', 'text', trim(strip_tags($_POST['pageheader-words'])));
}
info(L10n::t('pageheader Settings saved.') . EOL); info(L10n::t('pageheader Settings saved.') . EOL);
} }
} }