From 8879776d6436ed5257648a1873ddaa9486b25070 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 23 Oct 2022 14:02:19 +0200 Subject: fix php warnings --- Zotlabs/Module/Settings/Channel.php | 9 +++++---- Zotlabs/Module/Settings/Display.php | 10 +++++----- 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'Zotlabs/Module/Settings') diff --git a/Zotlabs/Module/Settings/Channel.php b/Zotlabs/Module/Settings/Channel.php index 840efc162..1e0c2a2db 100644 --- a/Zotlabs/Module/Settings/Channel.php +++ b/Zotlabs/Module/Settings/Channel.php @@ -27,10 +27,10 @@ class Channel { $photo_path = ((x($_POST, 'photo_path')) ? escape_tags(trim($_POST['photo_path'])) : ''); $attach_path = ((x($_POST, 'attach_path')) ? escape_tags(trim($_POST['attach_path'])) : ''); $allow_location = (((x($_POST, 'allow_location')) && (intval($_POST['allow_location']) == 1)) ? 1 : 0); - $post_newfriend = (($_POST['post_newfriend'] == 1) ? 1 : 0); - $post_joingroup = (($_POST['post_joingroup'] == 1) ? 1 : 0); - $post_profilechange = (($_POST['post_profilechange'] == 1) ? 1 : 0); - $adult = (($_POST['adult'] == 1) ? 1 : 0); + $post_newfriend = ((isset($_POST['post_newfriend']) && $_POST['post_newfriend'] == 1) ? 1 : 0); + $post_joingroup = ((isset($_POST['post_joingroup']) && $_POST['post_joingroup'] == 1) ? 1 : 0); + $post_profilechange = ((isset($_POST['post_profilechange']) && $_POST['post_profilechange'] == 1) ? 1 : 0); + $adult = ((isset($_POST['adult']) && $_POST['adult'] == 1) ? 1 : 0); $mailhost = ((array_key_exists('mailhost', $_POST)) ? notags(trim($_POST['mailhost'])) : ''); $pageflags = $channel['channel_pageflags']; $existing_adult = (($pageflags & PAGE_ADULT) ? 1 : 0); @@ -152,6 +152,7 @@ class Channel { Master::Summon(['Directory', local_channel()]); Libsync::build_sync_packet(); + $email_changed = false; if ($email_changed && App::$config['system']['register_policy'] == REGISTER_VERIFY) { // FIXME - set to un-verified, blocked and redirect to logout diff --git a/Zotlabs/Module/Settings/Display.php b/Zotlabs/Module/Settings/Display.php index 11181907b..ea9ae2da1 100644 --- a/Zotlabs/Module/Settings/Display.php +++ b/Zotlabs/Module/Settings/Display.php @@ -90,8 +90,8 @@ class Display { $default_theme = 'redbasic'; $themespec = explode(':', \App::$channel['channel_theme']); - $existing_theme = $themespec[0]; - $existing_schema = $themespec[1]; + $existing_theme = $themespec[0] ?? ''; + $existing_schema = $themespec[1] ?? ''; $theme = (($existing_theme) ? $existing_theme : $default_theme); @@ -207,12 +207,12 @@ class Display { function get_theme_config_file($theme){ - $base_theme = \App::$theme_info['extends']; + $base_theme = \App::$theme_info['extends'] ?? ''; - if (file_exists("view/theme/$theme/php/config.php")){ + if ($theme && file_exists("view/theme/$theme/php/config.php")){ return "view/theme/$theme/php/config.php"; } - if (file_exists("view/theme/$base_theme/php/config.php")){ + if ($base_theme && file_exists("view/theme/$base_theme/php/config.php")){ return "view/theme/$base_theme/php/config.php"; } return null; -- cgit v1.2.3