$this->setQuirk('png_transparency');
}
- /* IE 6 (pre-SP1) and 5.5 (pre-SP1) have buggy compression.
- * The versions affected are as follows:
- * 6.00.2462.0000 Internet Explorer 6 Public Preview (Beta)
- * 6.00.2479.0006 Internet Explorer 6 Public Preview (Beta) Refresh
- * 6.00.2600.0000 Internet Explorer 6 (Windows XP)
- * 5.50.3825.1300 Internet Explorer 5.5 Developer Preview (Beta)
- * 5.50.4030.2400 Internet Explorer 5.5 & Internet Tools Beta
- * 5.50.4134.0100 Internet Explorer 5.5 for Windows Me (4.90.3000)
- * 5.50.4134.0600 Internet Explorer 5.5
- * 5.50.4308.2900 Internet Explorer 5.5 Advanced Security Privacy Beta
- *
- * See:
- * ====
- * http://support.microsoft.com/kb/164539;
- * http://support.microsoft.com/default.aspx?scid=kb;en-us;Q312496)
- * http://support.microsoft.com/default.aspx?scid=kb;en-us;Q313712
- */
- $ie_vers = $this->getIEVersion();
- $buggy_list = array(
- '6,00,2462,0000', '6,0,2462,0', '6,00,2479,0006',
- '6,0,2479,0006', '6,00,2600,0000', '6,0,2600,0',
- '5,50,3825,1300', '5,50,4030,2400', '5,50,4134,0100',
- '5,50,4134,0600', '5,50,4308,2900'
- );
- if (!is_null($ie_vers) && in_array($ie_vers, $buggy_list)) {
- $this->setQuirk('buggy_compression');
- }
-
/* Some Handhelds have their screen resolution in the user
* agent string, which we can use to look for mobile
* agents. */
return in_array($subtype, $this->_images);
}
- /**
- * Sets the IE version in the session.
- *
- * @param string $ver The IE Version string.
- */
- public function setIEVersion($ver)
- {
- $_SESSION['horde_browser'] = array(
- 'ie_version' => $ver
- );
- }
-
- /**
- * Returns the IE version stored in the session, if available.
- *
- * @return mixed The IE Version string or null if no string is stored.
- */
- public function getIEVersion()
- {
- return isset($_SESSION['horde_browser']['ie_version'])
- ? $_SESSION['horde_browser']['ie_version']
- : null;
- }
-
}
<api>beta</api>
</stability>
<license uri="http://www.gnu.org/copyleft/lesser.html">LGPL</license>
- <notes>* Remove PEAR dependency.
+ <notes>* Remove PEAR and horde/Core dependencies.
* Remove Horde_Browser::escapeJSCode().
* Add Horde_Browser_Exception::.
* Initial Horde 4 package.</notes>
--- /dev/null
+<?php
+/**
+ * The Horde_Core_Browser class extends the base Horde_Browser class by
+ * allowing storage of IE version information in order to identify additional
+ * browser quirks.
+ *
+ * Copyright 2010 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (LGPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
+ *
+ * @author Michael Slusarz <slusarz@horde.org>
+ * @category Horde
+ * @license http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @package Core
+ */
+class Horde_Core_Browser extends Horde_Browser
+{
+ /**
+ */
+ public function match($userAgent = null, $accept = null)
+ {
+ parent::match($userAgent, $accept);
+
+ if ($this->isBrowser('msie')) {
+ /* IE 6 (pre-SP1) and 5.5 (pre-SP1) have buggy compression.
+ * The versions affected are as follows:
+ * 6.00.2462.0000 Internet Explorer 6 Public Preview (Beta)
+ * 6.00.2479.0006 Internet Explorer 6 Public Preview (Beta) Refresh
+ * 6.00.2600.0000 Internet Explorer 6 (Windows XP)
+ * 5.50.3825.1300 Internet Explorer 5.5 Developer Preview (Beta)
+ * 5.50.4030.2400 Internet Explorer 5.5 & Internet Tools Beta
+ * 5.50.4134.0100 Internet Explorer 5.5 for Windows Me (4.90.3000)
+ * 5.50.4134.0600 Internet Explorer 5.5
+ * 5.50.4308.2900 Internet Explorer 5.5 Advanced Security Privacy Beta
+ *
+ * See:
+ * ====
+ * http://support.microsoft.com/kb/164539;
+ * http://support.microsoft.com/default.aspx?scid=kb;en-us;Q312496)
+ * http://support.microsoft.com/default.aspx?scid=kb;en-us;Q313712
+ */
+ $ie_vers = $this->getIEVersion();
+ $buggy_list = array(
+ '6,00,2462,0000', '6,0,2462,0', '6,00,2479,0006',
+ '6,0,2479,0006', '6,00,2600,0000', '6,0,2600,0',
+ '5,50,3825,1300', '5,50,4030,2400', '5,50,4134,0100',
+ '5,50,4134,0600', '5,50,4308,2900'
+ );
+ if (!is_null($ie_vers) && in_array($ie_vers, $buggy_list)) {
+ $this->setQuirk('buggy_compression');
+ }
+ }
+ }
+
+ /**
+ * Sets the IE version in the session.
+ *
+ * @param string $ver The IE Version string.
+ */
+ public function setIEVersion($ver)
+ {
+ $_SESSION['horde_browser'] = array(
+ 'ie_version' => $ver
+ );
+ }
+
+ /**
+ * Returns the IE version stored in the session, if available.
+ *
+ * @return mixed The IE Version string or null if no string is stored.
+ */
+ public function getIEVersion()
+ {
+ return isset($_SESSION['horde_browser']['ie_version'])
+ ? $_SESSION['horde_browser']['ie_version']
+ : null;
+ }
+
+}
--- /dev/null
+<?php
+/**
+ * @category Horde
+ * @package Core
+ */
+class Horde_Core_Factory_Browser
+{
+ /**
+ */
+ public function create(Horde_Injector $injector)
+ {
+ return new Horde_Core_Browser();
+ }
+
+}
switch ($args['session_control']) {
case 'netscape':
// Chicken/egg: Browser object doesn't exist yet.
- $browser = new Horde_Browser();
+ $browser = new Horde_Core_Browser();
if ($browser->isBrowser('mozilla')) {
session_cache_limiter('private, must-revalidate');
}
* second element in an array. */
$factories = array(
'Horde_Alarm' => 'Horde_Core_Factory_Alarm',
+ 'Horde_Browser' => 'Horde_Core_Factory_Browser',
'Horde_Cache' => 'Horde_Core_Factory_Cache',
'Horde_Cache_Session' => array(
'Horde_Core_Factory_Cache',
<file name="Ajax.php" role="php" />
<file name="Alarm.php" role="php" />
<file name="Auth.php" role="php" />
+ <file name="Browser.php" role="php" />
<file name="Cache.php" role="php" />
<file name="Crypt.php" role="php" />
<file name="Data.php" role="php" />
<file name="VarRenderer.php" role="php" />
<file name="Widget.php" role="php" />
</dir> <!-- /lib/Horde/Core/Ui -->
+ <file name="Browser.php" role="php" />
<file name="Sidebar.php" role="php" />
</dir> <!-- /lib/Horde/Core -->
<dir name="Exception">
<install as="Horde/Session.php" name="lib/Horde/Session.php" />
<install as="Horde/Themes.php" name="lib/Horde/Themes.php" />
<install as="Horde/Config/Form.php" name="lib/Horde/Config/Form.php" />
+ <install as="Horde/Core/Browser.php" name="lib/Horde/Core/Browser.php" />
<install as="Horde/Core/Sidebar.php" name="lib/Horde/Core/Sidebar.php" />
<install as="Horde/Core/Ajax/Application.php" name="lib/Horde/Core/Ajax/Application.php" />
<install as="Horde/Core/Ajax/Imple.php" name="lib/Horde/Core/Ajax/Imple.php" />
<install as="Horde/Core/Factory/Ajax.php" name="lib/Horde/Core/Factory/Ajax.php" />
<install as="Horde/Core/Factory/Alarm.php" name="lib/Horde/Core/Factory/Alarm.php" />
<install as="Horde/Core/Factory/Auth.php" name="lib/Horde/Core/Factory/Auth.php" />
+ <install as="Horde/Core/Factory/Browser.php" name="lib/Horde/Core/Factory/Browser.php" />
<install as="Horde/Core/Factory/Cache.php" name="lib/Horde/Core/Factory/Cache.php" />
<install as="Horde/Core/Factory/Crypt.php" name="lib/Horde/Core/Factory/Crypt.php" />
<install as="Horde/Core/Factory/Data.php" name="lib/Horde/Core/Factory/Data.php" />