Apache2-WURFLFilter
view release on metacpan or search on metacpan
lib/Apache2/AMFCommonLib.pm view on Meta::CPAN
if (@_) {
$self->{'printLog'} = shift;
}
my $data=Data();
print "$data - $self->{'printLog'}\n";
}
sub GetMultipleUa {
my $self = shift;
my $UserAgent;
if (@_) {
$UserAgent = shift;
}
my %ArrayPM;
my $pair;
my $ind=0;
my $pairs3;
my %ArrayUAparse;
my @pairs = split(/\ /, $UserAgent);
foreach $pair (@pairs)
{
if ($ind==0) {
if ($pair =~ /\//o) {
my @pairs2 = split(/\//, $pair);
foreach $pairs3 (@pairs2) {
if ($ind==0) {
$ind=$ind+1;
$ArrayUAparse{$ind}=$pairs3;
} else {
$ind=$ind+1;
$ArrayUAparse{$ind}="$ArrayUAparse{$ind-1}\/$pairs3";
}
}
} else {
$ind=$ind+1;
$ArrayUAparse{$ind}="$pair";
}
} else {
if ($pair =~ /\//o) {
my $ind2=0;
my @pairs2 = split(/\//, $pair);
foreach $pairs3 (@pairs2) {
if ($ind2==0) {
$ind=$ind+1;
$ind2=1;
$ArrayUAparse{$ind}="$ArrayUAparse{$ind-1} $pairs3";
} else {
$ind=$ind+1;
$ArrayUAparse{$ind}="$ArrayUAparse{$ind-1}\/$pairs3";
}
}
} else {
$ind=$ind+1;
$ArrayUAparse{$ind}="$ArrayUAparse{$ind-1} $pair";
}
}
}
return %ArrayUAparse;
}
sub readCookie {
my $self = shift;
my $cookie_search;
if (@_) {
$cookie_search = shift;
}
my $param_tofound;
my $string_tofound;
my $value="";
my $id_return="";
my @pairs = split(/;/, $cookie_search);
my $name;
foreach $param_tofound (@pairs) {
($string_tofound,$value)=split(/=/, $param_tofound);
if ($string_tofound eq "amf") {
$id_return=$value;
}
}
return $id_return;
}
sub extValueTag {
my $self = shift;
my ($tag,$string);
if (@_) {
$tag = shift;
$string = shift;
}
#my ($tag,$string) = @_;
my $a_tag="\<$tag";
my $b_tag="\<\/$tag\>";
my $finish=index($string,"\>") + 1;
my $x=$finish;
my $y=index($string,$b_tag);
my $return_tag=substr($string,$x,$y - $x);
return $return_tag;
}
=head1 NAME
Apache2::AMFCommonLib - Common Library That AMF uses.
=head1 DESCRIPTION
Is a simple Common Library for AMF
=head1 SEE ALSO
For more details: http://www.idelfuschini.it/apache-mobile-filter-v2x.html
Mobile Demo page of the filter: http://apachemobilefilter.nogoogle.it (thanks Ivan alias sigmund)
Demo page of the filter: http://apachemobilefilter.nogoogle.it/php_test.php (thanks Ivan alias sigmund)
=head1 AUTHOR
Idel Fuschini (idel.fuschini [at] gmail [dot] com)
=cut
( run in 0.817 second using v1.01-cache-2.11-cpan-6aa56a78535 )