From 88f1016fbac5ba47794fa022a571fb1165a693c5 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Sun, 25 Nov 2007 10:15:27 +0100 Subject: [PATCH] Parser/WebserverTools.pm: Updated the browser recognition. --- lib/Yaala/Parser/WebserverTools.pm | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/lib/Yaala/Parser/WebserverTools.pm b/lib/Yaala/Parser/WebserverTools.pm index 206289e..695d591 100644 --- a/lib/Yaala/Parser/WebserverTools.pm +++ b/lib/Yaala/Parser/WebserverTools.pm @@ -112,7 +112,22 @@ sub detect_browser } my $name = 'unknown'; - if ($browser =~ /Lynx/i) { $name = 'Lynx'; } + if ($browser =~ /Mozilla/i) + { + if ($browser =~ m/Firefox|Iceweasel|Minefield|BonEcho/i) { $name = 'Firefox'; } + elsif ($browser =~ m/SeaMonkey/i) { $name = 'SeaMonkey'; } + elsif ($browser =~ m/Konqueror/i) { $name = 'Konqueror'; } + elsif ($browser =~ m/Safari/i) { $name = 'Safari'; } + elsif ($browser =~ m/MSIE/i) { $name = 'MSIE'; } + elsif ($browser =~ m/Epiphany/i) { $name = 'Epiphany'; } + elsif ($browser =~ m/compatible/i) { $name = 'Netscape compatible'; } + elsif ($browser =~ m!Mozilla/[0-4]!i or $browser =~ m/Netscape/i) { $name = 'Netscape Navigator'; } + else + { + $name = 'Mozilla'; + } + } + elsif ($browser =~ /Lynx/i) { $name = 'Lynx'; } elsif ($browser =~ /Links/i) { $name = 'Links'; } elsif ($browser =~ /Opera/i) { $name = 'Opera'; } elsif ($browser =~ /WebTV/i) { $name = 'WebTV'; } @@ -120,20 +135,6 @@ sub detect_browser elsif ($browser =~ /wget/i) { $name = 'wget'; } elsif ($browser =~ /GetRight|GoZilla/i) { $name = 'Download Manager'; } elsif ($browser =~ /bot|Google|Slurp|Scooter|Spider|Infoseek|Crawl|Mercator|FireBall|av\.com|Teoma|Ask Jeeves/i) { $name = 'Search Engines'; } - elsif ($browser =~ /Mozilla/i) - { - if ($browser =~ /Galeon/i) { $name = 'Galeon'; } - elsif ($browser =~ /Phoenix/i) { $name = 'Phoenix'; } - elsif ($browser =~ /Chimera|Camino/i) { $name = 'Camino'; } - elsif ($browser =~ /Konqueror/i) { $name = 'Konqueror'; } - elsif ($browser =~ /Safari/i) { $name = 'Safari'; } - elsif ($browser =~ /MultiZilla/i) { $name = 'MultiZilla'; } - elsif ($browser =~ /MSIE/i) { $name = 'MSIE'; } - elsif ($browser =~ /compatible/i) { $name = 'Netscape compatible'; } - elsif ($browser =~ m!Mozilla/[0-4]!i or $browser =~ m/Netscape/i) - { $name = 'Netscape Navigator'; } - else { $name = 'Mozilla'; } - } elsif ($::DEBUG & 0x2000) { print $/, __FILE__, ": Unknown browser: '$browser'"; @@ -141,7 +142,7 @@ sub detect_browser $recognized_browsers{$browser} = $name; return ($name); -} +} # detect_browser sub detect_os # uses the same string "detect_browser" does, -- 2.11.0