X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FForm.pm;h=55b6f695dc0abd257f3fec7ca6591af8eeee6d34;hb=ad27efa6a3b7e8feea8497c24acebe5bd501156b;hp=6ad6a920875f4446b27efdf24e14cbd3a36b360e;hpb=78f0df906055d13bbbb9f84e900a7c82a67d0045;p=kivitendo-erp.git diff --git a/SL/Form.pm b/SL/Form.pm index 6ad6a9208..55b6f695d 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -265,7 +265,11 @@ sub new { $self->{action} = lc $self->{action}; $self->{action} =~ s/( |-|,|\#)/_/g; - $self->{version} = "2.6.1"; + #$self->{version} = "2.6.1"; # Old hardcoded but secure style + 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. $main::lxdebug->leave_sub(); @@ -466,13 +470,22 @@ sub info { if (!$self->{header}) { $self->header; - print qq| - |; + print qq||; } print qq| - -

$msg +

$msg

+ + + + |; } else { @@ -659,6 +672,15 @@ sub header { | if $self->{"fokus"}; + my $title_hack = qq| + + |; + #Set Calendar my $jsscript = ""; if ($self->{jsscript} == 1) { @@ -694,9 +716,9 @@ sub header { $favicon $jsscript $ajax - $fokus - + $title_hack + @@ -1547,15 +1569,21 @@ sub datetonum { # Database routines used throughout +sub _dbconnect_options { + my $self = shift; + my $options = { pg_enable_utf8 => $::locale->is_utf8, + @_ }; + + return $options; +} + sub dbconnect { $main::lxdebug->enter_sub(2); my ($self, $myconfig) = @_; # connect to database - my $dbh = - DBI->connect($myconfig->{dbconnect}, - $myconfig->{dbuser}, $myconfig->{dbpasswd}) + my $dbh = DBI->connect($myconfig->{dbconnect}, $myconfig->{dbuser}, $myconfig->{dbpasswd}, $self->_dbconnect_options) or $self->dberror; # set db options @@ -1574,9 +1602,7 @@ sub dbconnect_noauto { my ($self, $myconfig) = @_; # connect to database - my $dbh = - DBI->connect($myconfig->{dbconnect}, $myconfig->{dbuser}, - $myconfig->{dbpasswd}, { AutoCommit => 0 }) + my $dbh = DBI->connect($myconfig->{dbconnect}, $myconfig->{dbuser}, $myconfig->{dbpasswd}, $self->_dbconnect_options(AutoCommit => 0)) or $self->dberror; # set db options