"I came across this snippet in our header file," wrote David, "it's a basic webspider detector that is used later on to record certain actions differently if $is_spider was set to 1."

"Rather than check the difference between 0 and FALSE (or use a more appropriate function), the original developer just dropped the first letter of each crawler name so that strpos doesn't return 0."

$spider_footprint = array('ooglebot', 'rawler', 'pider', 'ulliver',
                          'arvest', 'ahoo! Slurp');
foreach($spider_footprint as $spider_name)
{
   if (strpos($agent, $spider_name))
   {
      $is_spider = 1;
      break;
   }
}
[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!