From b154cbc6eeb97078ecd4226f6f04217fb3ac703b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Wed, 17 Nov 2021 13:09:54 +0100 Subject: [PATCH] Webshop speichern: Zumindestens etwas mehr Eingabevalidierung, vor DB-Fehlern --- SL/DB/Shop.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/SL/DB/Shop.pm b/SL/DB/Shop.pm index 63f988f03..e75f17c6e 100644 --- a/SL/DB/Shop.pm +++ b/SL/DB/Shop.pm @@ -16,10 +16,13 @@ sub validate { my ($self) = @_; my @errors; - + # critical checks push @errors, $::locale->text('The description is missing.') unless $self->{description}; - push @errors, $::locale->text('The path is missing.') unless $self->{path}; - + push @errors, $::locale->text('The path is missing.') unless $self->{path}; + push @errors, $::locale->text('The Host Name is missing') unless $self->{server}; + push @errors, $::locale->text('The Host Name seems invalid') unless $self->{server} =~ m/[0-9A-Za-z].\.[0-9A-Za-z]/; + push @errors, $::locale->text('Orders to fetch neeeds a positive Integer') + unless $self->{orders_to_fetch} > 0; return @errors; } -- 2.20.1