Avoiding notices #792

Merged
annando merged 1 commit from notices into 2019.01-rc 2019-01-13 19:30:08 +01:00

View file

@ -148,19 +148,17 @@ function wppost_settings(&$a,&$s) {
function wppost_settings_post(&$a,&$b) { function wppost_settings_post(&$a,&$b) {
if(!empty($_POST['wppost-submit'])) { if(!empty($_POST['wppost-submit'])) {
PConfig::set(local_user(),'wppost','post',intval($_POST['wppost'])); 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_username',trim($_POST['wp_username']));
PConfig::set(local_user(),'wppost','wp_password',trim($_POST['wp_password'])); 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','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'])); PConfig::set(local_user(),'wppost','shortcheck',trim($_POST['wp_shortcheck']));
$wp_backlink_text = Strings::escapeTags(trim($_POST['wp_backlink_text'])); $wp_backlink_text = Strings::escapeTags(trim($_POST['wp_backlink_text']));
$wp_backlink_text = BBCode::convert($wp_backlink_text, false, 8); $wp_backlink_text = BBCode::convert($wp_backlink_text, false, 8);
$wp_backlink_text = HTML::toPlaintext($wp_backlink_text, 0, true); $wp_backlink_text = HTML::toPlaintext($wp_backlink_text, 0, true);
PConfig::set(local_user(),'wppost','wp_backlink_text', $wp_backlink_text); PConfig::set(local_user(),'wppost','wp_backlink_text', $wp_backlink_text);
} }
} }