Navigation Menu

Skip to content

Commit

Permalink
Item14175: remove browser detection in Logger
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDaum committed Sep 7, 2016
1 parent 097f9a1 commit 17dd5ff
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions core/lib/Foswiki/Logger.pm
Expand Up @@ -128,7 +128,6 @@ This routine assigns values to some common fields that are useful in logs.
In the older Logging API, these were only provided by the Foswiki::writeEvent()
method for "info" level events.
| =$fhash->{agent}= | The user agent |
| =$fhash->{timestamp}= | The time of the event |
| =$fhash->{user}= | The logged in user, if any |
| =$fhash->{webTopic}= | The current topic |
Expand All @@ -145,26 +144,6 @@ sub setCommonFields {
$login = $users->getLoginName($user) if ($users);
$_[0]->{user} = $login if $login;

unless ( defined $_[0]->{agent} ) {
my $agent = '';
my $cgiQuery = $Foswiki::Plugins::SESSION->{request};
if ($cgiQuery) {
my $agentStr = $cgiQuery->user_agent();
if ($agentStr) {
if ( $agentStr =~
m/(MSIE 6|MSIE 7|MSIE 8|MSI 9|Firefox|Opera|Konqueror|Chrome|Safari)/
)
{
$_[0]->{agent} = $1;
}
else {
$agentStr =~ m/([\w]+)/;
$_[0]->{agent} = $1;
}
}
}
}

unless ( defined $_[0]->{remoteAddr} ) {
$_[0]->{remoteAddr} =
$Foswiki::Plugins::SESSION->{request}->remoteAddress() || ''
Expand Down

0 comments on commit 17dd5ff

Please sign in to comment.