X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FForm.pm;h=6a1fa813cdd22c04255e7dcabceaa2426f0d07de;hb=a143b82a56e889cfda60c2d42fe7d0bdaf73aa83;hp=95034e57bcb067d22dbdeea0f5c4246d11dacc8e;hpb=86be28e9b1744d86e2db534c3d2b005eb5f144f5;p=kivitendo-erp.git
diff --git a/SL/Form.pm b/SL/Form.pm
index 95034e57b..6a1fa813c 100644
--- a/SL/Form.pm
+++ b/SL/Form.pm
@@ -36,11 +36,19 @@
#======================================================================
package Form;
+use Data::Dumper;
+use Cwd;
use HTML::Template;
+use SL::Template;
+use CGI::Ajax;
+use SL::DBUtils;
+use SL::Menu;
+use SL::User;
+use CGI;
sub _input_to_hash {
- $main::lxdebug->enter_sub();
+ $main::lxdebug->enter_sub(2);
my $input = $_[0];
my %in = ();
@@ -51,13 +59,13 @@ sub _input_to_hash {
$in{$name} = unescape(undef, $value);
}
- $main::lxdebug->leave_sub();
+ $main::lxdebug->leave_sub(2);
return %in;
}
sub _request_to_hash {
- $main::lxdebug->enter_sub();
+ $main::lxdebug->enter_sub(2);
my ($input) = @_;
my ($i, $loc, $key, $val);
@@ -108,11 +116,11 @@ sub _request_to_hash {
}
}
- $main::lxdebug->leave_sub();
+ $main::lxdebug->leave_sub(2);
return %ATTACH;
} else {
- $main::lxdebug->leave_sub();
+ $main::lxdebug->leave_sub(2);
return _input_to_hash($input);
}
}
@@ -137,13 +145,10 @@ sub new {
my %parameters = _request_to_hash($_);
map({ $self->{$_} = $parameters{$_}; } keys(%parameters));
- $self->{menubar} = 1 if $self->{path} =~ /lynx/i;
-
$self->{action} = lc $self->{action};
- $self->{action} =~ s/( |-|,|#)/_/g;
+ $self->{action} =~ s/( |-|,|\#)/_/g;
- $self->{version} = "2.2.0";
- $self->{dbversion} = "2.2.0";
+ $self->{version} = "2.4.2";
$main::lxdebug->leave_sub();
@@ -163,7 +168,7 @@ sub debug {
}
sub escape {
- $main::lxdebug->enter_sub();
+ $main::lxdebug->enter_sub(2);
my ($self, $str, $beenthere) = @_;
@@ -174,13 +179,13 @@ sub escape {
$str =~ s/([^a-zA-Z0-9_.-])/sprintf("%%%02x", ord($1))/ge;
- $main::lxdebug->leave_sub();
+ $main::lxdebug->leave_sub(2);
return $str;
}
sub unescape {
- $main::lxdebug->enter_sub();
+ $main::lxdebug->enter_sub(2);
my ($self, $str) = @_;
@@ -189,7 +194,7 @@ sub unescape {
$str =~ s/%([0-9a-fA-Z]{2})/pack("c",hex($1))/eg;
- $main::lxdebug->leave_sub();
+ $main::lxdebug->leave_sub(2);
return $str;
}
@@ -198,7 +203,7 @@ sub quote {
my ($self, $str) = @_;
if ($str && !ref($str)) {
- $str =~ s/"/"/g;
+ $str =~ s/\"/"/g;
}
$str;
@@ -209,13 +214,32 @@ sub unquote {
my ($self, $str) = @_;
if ($str && !ref($str)) {
- $str =~ s/"/"/g;
+ $str =~ s/"/\"/g;
}
$str;
}
+sub quote_html {
+ $main::lxdebug->enter_sub(2);
+
+ my ($self, $str) = @_;
+
+ my %replace =
+ ('order' => ['"', '<', '>'],
+ '<' => '<',
+ '>' => '>',
+ '"' => '"',
+ );
+
+ map({ $str =~ s/$_/$replace{$_}/g; } @{ $replace{"order"} });
+
+ $main::lxdebug->leave_sub(2);
+
+ return $str;
+}
+
sub hide_form {
my $self = shift;
@@ -240,24 +264,9 @@ sub error {
$main::lxdebug->enter_sub();
my ($self, $msg) = @_;
-
if ($ENV{HTTP_USER_AGENT}) {
$msg =~ s/\n/
/g;
-
- $self->header;
-
- print qq|
-
$msg - - -