Trim whitespace from serials when checking out and returning products

This commit is contained in:
Erik Thuning 2022-07-27 13:15:06 +02:00
parent 4e9e5b93af
commit ae8b73cb88

@ -87,7 +87,7 @@ class Ajax extends Responder {
}
$product = null;
try {
$product = new Product($_POST['product'], 'serial');
$product = new Product(trim($_POST['product']), 'serial');
} catch(Exception $e) {
return new Failure('Ogiltigt serienummer.');
}
@ -102,7 +102,7 @@ class Ajax extends Responder {
private function return_product() {
$product = null;
try {
$product = new Product($_POST['serial'], 'serial');
$product = new Product(trim($_POST['serial']), 'serial');
} catch(Exception $e) {
return new Failure('Ogiltigt serienummer.');
}