TightURL

TightURL Git Source Tree

Root/bad-behavior/bad-behavior/msie.inc.php

1<?php if (!defined('BB2_CORE')) die('I said no cheating!');
2
3// Analyze user agents claiming to be MSIE
4
5function bb2_msie($package)
6{
7    if (!array_key_exists('Accept', $package['headers_mixed'])) {
8        return "17566707";
9    }
10
11    // MSIE does NOT send "Windows ME" or "Windows XP" in the user agent
12    if (strpos($package['headers_mixed']['User-Agent'], "Windows ME") !== FALSE || strpos($package['headers_mixed']['User-Agent'], "Windows XP") !== FALSE || strpos($package['headers_mixed']['User-Agent'], "Windows 2000") !== FALSE || strpos($package['headers_mixed']['User-Agent'], "Win32") !== FALSE) {
13        return "a1084bad";
14    }
15
16    // MSIE does NOT send Connection: TE but Akamai does
17    // Bypass this test when Akamai detected
18    if (!array_key_exists('Akamai-Origin-Hop', $package['headers_mixed']) && @preg_match('/\bTE\b/i', $package['headers_mixed']['Connection'])) {
19        return "2b90f772";
20    }
21
22    return false;
23}
24
25?>
26

Archive Download this file

Branches