[CONTROLLER][AdminPanel] Further ensure form validity
This commit is contained in:
parent
38a331220f
commit
afbcb179b2
@ -72,6 +72,12 @@ class AdminPanel extends Controller
|
|||||||
$data = $form->getData();
|
$data = $form->getData();
|
||||||
if ($form->isValid() && array_key_exists('setting', $data)) {
|
if ($form->isValid() && array_key_exists('setting', $data)) {
|
||||||
[$section, $setting] = explode(':', $data['setting']);
|
[$section, $setting] = explode(':', $data['setting']);
|
||||||
|
if (!isset($defaults[$section]) && !isset($defaults[$section][$setting])) {
|
||||||
|
// @codeCoverageIgnoreStart
|
||||||
|
throw new ClientException(_m('The supplied field doesn\'t exist'));
|
||||||
|
// @codeCoverageIgnoreEnd
|
||||||
|
}
|
||||||
|
|
||||||
foreach ([
|
foreach ([
|
||||||
'int' => FILTER_VALIDATE_INT,
|
'int' => FILTER_VALIDATE_INT,
|
||||||
'bool' => FILTER_VALIDATE_BOOL,
|
'bool' => FILTER_VALIDATE_BOOL,
|
||||||
|
Loading…
Reference in New Issue
Block a user