projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Autocompletion gegen Injection abgesichert.
[kivitendo-erp.git]
/
SL
/
LXDebug.pm
diff --git
a/SL/LXDebug.pm
b/SL/LXDebug.pm
index
185297b
..
3dbd14f
100644
(file)
--- a/
SL/LXDebug.pm
+++ b/
SL/LXDebug.pm
@@
-17,6
+17,8
@@
use POSIX qw(strftime);
use YAML;
use YAML;
+use strict;
+
my $data_dumper_available;
our $global_level;
my $data_dumper_available;
our $global_level;
@@
-104,9
+106,9
@@
sub leave_sub {
}
sub show_backtrace {
}
sub show_backtrace {
- my ($self) = @_;
+ my ($self
, $force
) = @_;
- return 1 unless ($
global_level & BACKTRACE_ON_ERROR
);
+ return 1 unless ($
force || ($global_level & BACKTRACE_ON_ERROR)
);
$self->message(BACKTRACE_ON_ERROR, "Starting full caller dump:");
my $level = 0;
$self->message(BACKTRACE_ON_ERROR, "Starting full caller dump:");
my $level = 0;
@@
-128,14
+130,22
@@
sub dump {
my ($self, $level, $name, $variable) = @_;
if ($data_dumper_available) {
my ($self, $level, $name, $variable) = @_;
if ($data_dumper_available) {
+ my $password;
+ if ($variable && ('Form' eq ref $variable) && defined $variable->{password}) {
+ $password = $variable->{password};
+ $variable->{password} = 'X' x 8;
+ }
+
my $dumper = Data::Dumper->new([$variable]);
$dumper->Sortkeys(1);
$self->message($level, "dumping ${name}:\n" . $dumper->Dump());
my $dumper = Data::Dumper->new([$variable]);
$dumper->Sortkeys(1);
$self->message($level, "dumping ${name}:\n" . $dumper->Dump());
+ $variable->{password} = $password if (defined $password);
+
# Data::Dumper does not reset the iterator belonging to this hash
# if 'Sortkeys' is true. Therefore clear the iterator manually.
# See "perldoc -f each".
# Data::Dumper does not reset the iterator belonging to this hash
# if 'Sortkeys' is true. Therefore clear the iterator manually.
# See "perldoc -f each".
- if ($variable && (
'HASH' eq ref $variable
)) {
+ if ($variable && (
('HASH' eq ref $variable) || ('Form' eq ref $variable)
)) {
keys %{ $variable };
}
keys %{ $variable };
}