From: Michael Date: Sun, 13 Jan 2019 18:05:37 +0000 (+0000) Subject: Avoiding notices X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ffe0ba9c5bac7f3dc46178743fad277da609e3e4;p=friendica-addons.git Avoiding notices --- diff --git a/wppost/wppost.php b/wppost/wppost.php index 1cc27976..d481d68f 100644 --- a/wppost/wppost.php +++ b/wppost/wppost.php @@ -148,19 +148,17 @@ function wppost_settings(&$a,&$s) { function wppost_settings_post(&$a,&$b) { if(!empty($_POST['wppost-submit'])) { - PConfig::set(local_user(),'wppost','post',intval($_POST['wppost'])); - PConfig::set(local_user(),'wppost','post_by_default',intval($_POST['wp_bydefault'])); + PConfig::set(local_user(),'wppost','post_by_default',intval(defaults($_POST, 'wp_bydefault', false))); PConfig::set(local_user(),'wppost','wp_username',trim($_POST['wp_username'])); PConfig::set(local_user(),'wppost','wp_password',trim($_POST['wp_password'])); PConfig::set(local_user(),'wppost','wp_blog',trim($_POST['wp_blog'])); - PConfig::set(local_user(),'wppost','backlink',trim($_POST['wp_backlink'])); + PConfig::set(local_user(),'wppost','backlink',trim(defaults($_POST, 'wp_backlink', ''))); PConfig::set(local_user(),'wppost','shortcheck',trim($_POST['wp_shortcheck'])); $wp_backlink_text = Strings::escapeTags(trim($_POST['wp_backlink_text'])); $wp_backlink_text = BBCode::convert($wp_backlink_text, false, 8); $wp_backlink_text = HTML::toPlaintext($wp_backlink_text, 0, true); PConfig::set(local_user(),'wppost','wp_backlink_text', $wp_backlink_text); - } }