Commit 783abebf authored by Franco Fichtner's avatar Franco Fichtner

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

(cherry picked from commit 6d443755)
(cherry picked from commit 2d42d843)
parent 1d13a5dd
......@@ -332,6 +332,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
}
}
if (isset($pconfig['serial']) && $pconfig['serial'] !== '' &&
((string)((int)$pconfig['serial']) != $pconfig['serial'] || $pconfig['serial'] < 1)) {
$input_errors[] = gettext('The serial number must be a number greater than zero or left blank.');
}
/* save modifications */
if (count($input_errors) == 0) {
$ca = array();
......@@ -349,7 +354,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