Browse Source

is_search_request in php and reorganizing

master
Duke Leto 16 years ago
parent
commit
c50cb3aef6
  1. 6
      perl_lib/Leto/Util/Web.pm
  2. 0
      perl_lib/t/Web.t
  3. 15
      php_lib/web_util.php

6
lib/Leto/Util/Web.pm → perl_lib/Leto/Util/Web.pm

@ -9,11 +9,11 @@ our @EXPORT = qw//;
sub is_search_request($)
{
my $r = shift;
my @engines = qw{
/search\?
my @engines = qw{
/search\?
images\.google
search\.yahoo\.com
msn\.com
msn\.com
live\.com
del\.icio\.us/search
};

0
lib/t/Web.t → perl_lib/t/Web.t

15
php_lib/web_util.php

@ -0,0 +1,15 @@
function is_search_request() {
$r = $_SERVER['HTTP_REFERER'];
$engines = array('/search?',
'images.google.',
'search.yahoo.com',
'del.icio.us/search',
'msn.com',
'live.com',
);
foreach ($engine as $eng) {
if (strpos($r,$eng) !== false)
return true;
}
return false;
}
Loading…
Cancel
Save