Skip to content

Commit

Permalink
Item10637: Undefined variable errors
Browse files Browse the repository at this point in the history
Don't touch the IP address unless parameters are present.

git-svn-id: http://svn.foswiki.org/trunk@12649 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
GeorgeClark authored and GeorgeClark committed Sep 29, 2011
1 parent da7b21c commit 6745ad9
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions core/lib/Foswiki/Logger/PlainFile/Obfuscating.pm
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,20 @@ sub log {
# print STDERR "field $field \n";
# }

unless ( $_[4] =~ /^AUTHENTICATION FAILURE/ ) {

if ( $Foswiki::cfg{Log}{Obfuscating}{MaskIP} ) {
$_[5] = 'x.x.x.x';
}
else {
my $md5hex = md5_hex( $_[5] );
$_[5] =
hex( substr( $md5hex, 0, 2 ) ) . '.'
. hex( substr( $md5hex, 2, 2 ) ) . '.'
. hex( substr( $md5hex, 4, 2 ) ) . '.'
. hex( substr( $md5hex, 6, 2 ) );
if ( @_ > 4 ) {
unless ( $_[4] =~ /^AUTHENTICATION FAILURE/ ) {

if ( $Foswiki::cfg{Log}{Obfuscating}{MaskIP} ) {
$_[5] = 'x.x.x.x';
}
else {
my $md5hex = md5_hex( $_[5] );
$_[5] =
hex( substr( $md5hex, 0, 2 ) ) . '.'
. hex( substr( $md5hex, 2, 2 ) ) . '.'
. hex( substr( $md5hex, 4, 2 ) ) . '.'
. hex( substr( $md5hex, 6, 2 ) );
}
}
}

Expand Down

0 comments on commit 6745ad9

Please sign in to comment.