1
0
Fork 0

Please use x() correctly:

<?php
if (x($someArray, 'element')) {
	// Do something
}
?>

Signed-off-by: Roland Haeder <roland@mxchange.org>
This commit is contained in:
Roland Häder 2017-03-30 21:36:34 +02:00
commit 5bc2ebb267
No known key found for this signature in database
GPG key ID: B72F8185C6C7BD78
3 changed files with 38 additions and 33 deletions

View file

@ -2017,22 +2017,22 @@ function admin_page_features_post(App $a) {
$features = get_features(false);
foreach ($features as $fname => $fdata) {
foreach (array_slice($fdata,1) as $f) {
foreach (array_slice($fdata, 1) as $f) {
$feature = $f[0];
$feature_state = 'feature_'.$feature;
$featurelock = 'featurelock_'.$feature;
$feature_state = 'feature_' . $feature;
$featurelock = 'featurelock_' . $feature;
if (x($_POST[$feature_state])) {
$val = intval($_POST['feature_'.$feature]);
if (x($_POST, $feature_state)) {
$val = intval($_POST[$feature_state]);
} else {
$val = 0;
}
set_config('feature',$feature,$val);
if (x($_POST[$featurelock])) {
set_config('feature_lock',$feature,$val);
if (x($_POST, $featurelock)) {
set_config('feature_lock', $feature, $val);
} else {
del_config('feature_lock',$feature);
del_config('feature_lock', $feature);
}
}
}