1: <?php
2: /**
3: * The Horde_Core_Browser class extends the base Horde_Browser class by
4: * allowing storage of IE version information in order to identify additional
5: * browser quirks.
6: *
7: * Copyright 2010-2012 Horde LLC (http://www.horde.org/)
8: *
9: * See the enclosed file COPYING for license information (LGPL). If you
10: * did not receive this file, see http://www.horde.org/licenses/lgpl21.
11: *
12: * @author Michael Slusarz <slusarz@horde.org>
13: * @category Horde
14: * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
15: * @package Core
16: */
17: class Horde_Core_Browser extends Horde_Browser
18: {
19: /**
20: */
21: public function match($userAgent = null, $accept = null)
22: {
23: parent::match($userAgent, $accept);
24:
25: if ($this->isBrowser('msie')) {
26: /* IE 6 (pre-SP1) and 5.5 (pre-SP1) have buggy compression.
27: * The versions affected are as follows:
28: * 6.00.2462.0000 Internet Explorer 6 Public Preview (Beta)
29: * 6.00.2479.0006 Internet Explorer 6 Public Preview (Beta) Refresh
30: * 6.00.2600.0000 Internet Explorer 6 (Windows XP)
31: * 5.50.3825.1300 Internet Explorer 5.5 Developer Preview (Beta)
32: * 5.50.4030.2400 Internet Explorer 5.5 & Internet Tools Beta
33: * 5.50.4134.0100 Internet Explorer 5.5 for Windows Me (4.90.3000)
34: * 5.50.4134.0600 Internet Explorer 5.5
35: * 5.50.4308.2900 Internet Explorer 5.5 Advanced Security Privacy Beta
36: *
37: * See:
38: * ====
39: * http://support.microsoft.com/kb/164539;
40: * http://support.microsoft.com/default.aspx?scid=kb;en-us;Q312496)
41: * http://support.microsoft.com/default.aspx?scid=kb;en-us;Q313712
42: */
43: $ie_vers = $this->getIEVersion();
44: $buggy_list = array(
45: '6,00,2462,0000', '6,0,2462,0', '6,00,2479,0006',
46: '6,0,2479,0006', '6,00,2600,0000', '6,0,2600,0',
47: '5,50,3825,1300', '5,50,4030,2400', '5,50,4134,0100',
48: '5,50,4134,0600', '5,50,4308,2900'
49: );
50: if (!is_null($ie_vers) && in_array($ie_vers, $buggy_list)) {
51: $this->setQuirk('buggy_compression');
52: }
53: }
54:
55: try {
56: Horde::callHook('browser_modify', array($this), 'horde');
57: } catch (Horde_Exception_HookNotSet $e) {
58: }
59: }
60:
61: /**
62: * Sets the IE version in the session.
63: *
64: * @param string $ver The IE Version string.
65: */
66: public function setIEVersion($ver)
67: {
68: $GLOBALS['session']->set('horde', 'ie_version', $ver);
69: }
70:
71: /**
72: * Returns the IE version stored in the session, if available.
73: *
74: * @return mixed The IE Version string or null if no string is stored.
75: */
76: public function getIEVersion()
77: {
78: return isset($GLOBALS['session'])
79: ? $GLOBALS['session']->get('horde', 'ie_version')
80: : null;
81: }
82:
83: }
84: