X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/bfe3243c4cdeacea07e53d6365bc384dfd0e6b4d..e9c2de7f8b54ba0dc7b8aafba99a7de66d71ceef:/SL/Form.pm?ds=inline diff --git a/SL/Form.pm b/SL/Form.pm index 330799766..8a82587e9 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -86,6 +86,17 @@ sub disconnect_standard_dbh { undef $standard_dbh; } +sub read_version { + my ($self) = @_; + + open VERSION_FILE, "VERSION"; # New but flexible code reads version from VERSION-file + my $version = ; + $version =~ s/[^0-9A-Za-z\.\_\-]//g; # only allow numbers, letters, points, underscores and dashes. Prevents injecting of malicious code. + close VERSION_FILE; + + return $version; +} + sub new { $main::lxdebug->enter_sub(); @@ -101,10 +112,7 @@ sub new { bless $self, $type; - open VERSION_FILE, "VERSION"; # New but flexible code reads version from VERSION-file - $self->{version} = ; - close VERSION_FILE; - $self->{version} =~ s/[^0-9A-Za-z\.\_\-]//g; # only allow numbers, letters, points, underscores and dashes. Prevents injecting of malicious code. + $self->{version} = $self->read_version; $main::lxdebug->leave_sub();