mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-20 03:16:12 +00:00
system: fix off by one and add validation; closes #1581
This commit is contained in:
parent
852657c789
commit
6d443755f0
@ -332,6 +332,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($pconfig['serial']) && ((string)((int)$pconfig['serial']) != $pconfig['serial'] || $pconfig['serial'] < 1)) {
|
||||
$input_errors[] = gettext('The serial number must be a number greater than zero.');
|
||||
}
|
||||
|
||||
/* save modifications */
|
||||
if (count($input_errors) == 0) {
|
||||
$ca = array();
|
||||
@ -349,7 +353,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
}
|
||||
|
||||
if (!empty($pconfig['serial'])) {
|
||||
$ca['serial'] = $pconfig['serial'];
|
||||
$ca['serial'] = $pconfig['serial'] - 1;
|
||||
}
|
||||
|
||||
if (isset($id)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user