From: Rolf Fluehmann Date: Tue, 7 Jan 2014 12:29:39 +0000 (+0100) Subject: 2220,2321: Validierung eingegebener Kunden- und Lieferantennamen X-Git-Tag: release-3.1.0beta1~22^2~27 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=03938396b8f77e5e08e392d54ce2f68cd8cca4ae;p=kivitendo-erp.git 2220,2321: Validierung eingegebener Kunden- und Lieferantennamen --- diff --git a/SL/Controller/CustomerVendor.pm b/SL/Controller/CustomerVendor.pm index de7749037..e5cb556ac 100644 --- a/SL/Controller/CustomerVendor.pm +++ b/SL/Controller/CustomerVendor.pm @@ -167,6 +167,17 @@ sub _save { sub action_save { my ($self) = @_; + my $pattern = '[ \t\n\r]+'; + my $name = $self->{cv}->name; + $name =~ s/^$pattern//; + $name =~ s/$pattern$//; + $name =~ s/$pattern/ /g; + if ( $name eq '' ) { + $::form->dberror( $::locale->text('Customer missing!') ); + } else { + $self->{cv}->name($name); + } + $self->_save(); my @redirect_params = (