line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CGI::Application::Plugin::DetectAjax; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
26082
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
40
|
|
4
|
1
|
|
|
1
|
|
5
|
use vars qw($VERSION @EXPORT); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
169
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
require Exporter; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
@CGI::Application::Plugin::DetectAjax::ISA = qw(Exporter); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
$VERSION = '0.06'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
@EXPORT = qw( |
13
|
|
|
|
|
|
|
is_ajax |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub is_ajax { |
17
|
|
|
|
|
|
|
|
18
|
3
|
|
|
3
|
1
|
454808
|
my $self = shift; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
3
|
|
|
|
|
6
|
my $header = 'HTTP_X_REQUESTED_WITH'; |
22
|
|
|
|
|
|
|
|
23
|
3
|
100
|
66
|
|
|
24
|
if (exists $ENV{$header} && lc $ENV{$header} eq 'xmlhttprequest') { |
24
|
1
|
|
|
|
|
8
|
return 1; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
else { |
27
|
2
|
|
|
|
|
11
|
return 0; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
__END__ |