Imported Upstream version 1.40
Angel Abad
12 years ago
26 | 26 | "Olaf Alders <olaf\@wundercounter.com> (current maintainer)" |
27 | 27 | ], |
28 | 28 | "dist_name" => "HTTP-BrowserDetect", |
29 | "dist_version" => "1.39", | |
29 | "dist_version" => "1.40", | |
30 | 30 | "license" => "perl", |
31 | 31 | "module_name" => "HTTP::BrowserDetect", |
32 | 32 | "recommends" => {}, |
0 | 0 | Revision history for Perl extension HTTP::BrowserDetect. |
1 | ||
2 | 1.40 2012-01-05 | |
3 | - Fixes false positive results for RealPlayer browser (John Oatis) | |
1 | 4 | |
2 | 5 | 1.39 2011-12-01 |
3 | 6 | - Adds logical groupings of test cases BrowserDetect.pm (Olivier Bilodeau) |
0 | This software is copyright (c) 2011 by Lee Semel. | |
0 | This software is copyright (c) 2012 by Lee Semel. | |
1 | 1 | |
2 | 2 | This is free software; you can redistribute it and/or modify it under |
3 | 3 | the same terms as the Perl 5 programming language system itself. |
11 | 11 | |
12 | 12 | --- The GNU General Public License, Version 1, February 1989 --- |
13 | 13 | |
14 | This software is Copyright (c) 2011 by Lee Semel. | |
14 | This software is Copyright (c) 2012 by Lee Semel. | |
15 | 15 | |
16 | 16 | This is free software, licensed under: |
17 | 17 | |
271 | 271 | |
272 | 272 | --- The Artistic License 1.0 --- |
273 | 273 | |
274 | This software is Copyright (c) 2011 by Lee Semel. | |
274 | This software is Copyright (c) 2012 by Lee Semel. | |
275 | 275 | |
276 | 276 | This is free software, licensed under: |
277 | 277 |
57 | 57 | "web" : "https://github.com/oalders/http-browserdetect" |
58 | 58 | } |
59 | 59 | }, |
60 | "version" : "1.39" | |
60 | "version" : "1.40" | |
61 | 61 | } |
62 | 62 |
33 | 33 | "strict" => 0, |
34 | 34 | "vars" => 0 |
35 | 35 | }, |
36 | "VERSION" => "1.39", | |
36 | "VERSION" => "1.40", | |
37 | 37 | "test" => { |
38 | 38 | "TESTS" => "t/*.t" |
39 | 39 | } |
2 | 2 | an HTTP user agent string |
3 | 3 | |
4 | 4 | VERSION |
5 | version 1.39 | |
5 | version 1.40 | |
6 | 6 | |
7 | 7 | SYNOPSIS |
8 | 8 | use HTTP::BrowserDetect; |
239 | 239 | netscape nav2 nav3 nav4 nav4up nav45 nav45up navgold nav6 nav6up |
240 | 240 | opera opera3 opera4 opera5 opera6 opera7 |
241 | 241 | realplayer |
242 | realplayer_browser | |
243 | The realplayer method above tests for the presence of either the RealPlayer | |
244 | plug-in "(r1 " or the browser "RealPlayer". To preserve | |
245 | "bugwards compatibility" and prevent false reporting, browser_string calls | |
246 | this method which ignores the "(r1 " plug-in signature. | |
242 | 247 | safari |
243 | 248 | staroffice |
244 | 249 | webtv |
462 | 467 | * Olaf Alders <olaf@wundercounter.com> (current maintainer) |
463 | 468 | |
464 | 469 | COPYRIGHT AND LICENSE |
465 | This software is copyright (c) 2011 by Lee Semel. | |
470 | This software is copyright (c) 2012 by Lee Semel. | |
466 | 471 | |
467 | 472 | This is free software; you can redistribute it and/or modify it under |
468 | 473 | the same terms as the Perl 5 programming language system itself. |
3 | 3 | author = Olaf Alders <olaf@wundercounter.com> (current maintainer) |
4 | 4 | license = Perl_5 |
5 | 5 | copyright_holder = Lee Semel |
6 | copyright_year = 2011 | |
7 | version = 1.39 | |
6 | copyright_year = 2012 | |
7 | version = 1.40 | |
8 | 8 | main_module = lib/HTTP/BrowserDetect.pm |
9 | 9 | |
10 | 10 | [GatherDir] |
0 | 0 | use strict; |
1 | 1 | package HTTP::BrowserDetect; |
2 | 2 | { |
3 | $HTTP::BrowserDetect::VERSION = '1.39'; | |
3 | $HTTP::BrowserDetect::VERSION = '1.40'; | |
4 | 4 | } |
5 | 5 | |
6 | 6 | use vars qw(@ISA @EXPORT @EXPORT_OK @ALL_TESTS); |
779 | 779 | |
780 | 780 | $self->{realplayer_version} = undef; |
781 | 781 | if ( $tests->{REALPLAYER} ) { |
782 | if ( $ua =~ /realplayer\/([\d\.]+)/ ) { | |
782 | if ( $ua =~ /realplayer\/([\d+\.]+)/ ) { | |
783 | 783 | $self->{realplayer_version} = $1; |
784 | 784 | my @version = split( /\./, $self->{realplayer_version} ); |
785 | 785 | $major = shift @version; |
786 | 786 | $minor = shift @version; |
787 | } | |
788 | elsif ( $ua =~ /realplayer\s(\w+)/ ){ | |
789 | $self->{realplayer_version} = $1; | |
787 | 790 | } |
788 | 791 | } |
789 | 792 | |
817 | 820 | $browser_string = 'Mosaic' if $self->mosaic; |
818 | 821 | $browser_string = 'Lynx' if $self->lynx; |
819 | 822 | $browser_string = 'Links' if $self->links; |
820 | $browser_string = 'RealPlayer' if $self->realplayer; | |
823 | $browser_string = 'RealPlayer' if $self->realplayer_browser; | |
821 | 824 | $browser_string = 'IceWeasel' if $self->iceweasel; |
822 | 825 | $browser_string = 'curl' if $self->curl; |
823 | 826 | $browser_string = 'puf' if $self->puf; |
879 | 882 | return 0; |
880 | 883 | } |
881 | 884 | |
885 | sub realplayer_browser { | |
886 | my ( $self, $check ) = _self_or_default( @_ ); | |
887 | return 1 if $self->{realplayer_version}; | |
888 | return 0; | |
889 | } | |
890 | ||
882 | 891 | sub gecko_version { |
883 | 892 | my ( $self, $check ) = _self_or_default( @_ ); |
884 | 893 | my $version; |
1200 | 1209 | |
1201 | 1210 | =head1 VERSION |
1202 | 1211 | |
1203 | version 1.39 | |
1212 | version 1.40 | |
1204 | 1213 | |
1205 | 1214 | =head1 SYNOPSIS |
1206 | 1215 | |
1485 | 1494 | |
1486 | 1495 | =head3 realplayer |
1487 | 1496 | |
1497 | =head3 realplayer_browser | |
1498 | The realplayer method above tests for the presence of either the RealPlayer | |
1499 | plug-in "(r1 " or the browser "RealPlayer". To preserve | |
1500 | "bugwards compatibility" and prevent false reporting, browser_string calls | |
1501 | this method which ignores the "(r1 " plug-in signature. | |
1502 | ||
1488 | 1503 | =head3 safari |
1489 | 1504 | |
1490 | 1505 | =head3 staroffice |
1761 | 1776 | |
1762 | 1777 | =head1 COPYRIGHT AND LICENSE |
1763 | 1778 | |
1764 | This software is copyright (c) 2011 by Lee Semel. | |
1779 | This software is copyright (c) 2012 by Lee Semel. | |
1765 | 1780 | |
1766 | 1781 | This is free software; you can redistribute it and/or modify it under |
1767 | 1782 | the same terms as the Perl 5 programming language system itself. |