some more notices and some code beautification

This commit is contained in:
Michael 2018-08-08 06:24:47 +00:00
parent cd2d98f39e
commit 7a29893ecb
6 changed files with 105 additions and 107 deletions

View file

@ -76,9 +76,9 @@ function langfilter_addon_settings_post(App $a, &$b)
return;
}
if ($_POST['langfilter-settings-submit']) {
if (!empty($_POST['langfilter-settings-submit'])) {
PConfig::set(local_user(), 'langfilter', 'languages', trim($_POST['langfilter_languages']));
$enable = ((x($_POST, 'langfilter_enable')) ? intval($_POST['langfilter_enable']) : 0);
$enable = (x($_POST, 'langfilter_enable') ? intval($_POST['langfilter_enable']) : 0);
$disable = 1 - $enable;
PConfig::set(local_user(), 'langfilter', 'disable', $disable);
$minconfidence = 0 + $_POST['langfilter_minconfidence'];