Commit 6d443755 authored by Franco Fichtner's avatar Franco Fichtner

system: fix off by one and add validation; closes #1581

parent 852657c7
......@@ -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)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment