From 2be3e342bae74207be9affa618e6858f57a91ff1 Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Sun, 7 Jun 2009 12:46:29 +0200 Subject: [PATCH] Make dataurl capability detection more precisely. --- framework/Browser/lib/Horde/Browser.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/framework/Browser/lib/Horde/Browser.php b/framework/Browser/lib/Horde/Browser.php index 0bfb901bf..bee2d1b4e 100644 --- a/framework/Browser/lib/Horde/Browser.php +++ b/framework/Browser/lib/Horde/Browser.php @@ -337,7 +337,6 @@ class Horde_Browser $this->setBrowser('opera'); list($this->_majorVersion, $this->_minorVersion) = explode('.', $version[1]); $this->setFeature('javascript'); - $this->setFeature('dataurl'); $this->setQuirk('no_filename_spaces'); /* Opera Mobile reports its screen resolution in the user @@ -351,9 +350,11 @@ class Horde_Browser $this->setFeature('xmlhttpreq'); $this->setFeature('javascript', 1.5); } - if (($this->_majorVersion >= 9) && - ($this->_minorVersion >= 5)) { - $this->setFeature('rte'); + if ($this->_majorVersion >= 9) { + $this->setFeature('dataurl'); + if ($this->_minorVersion >= 5) { + $this->setFeature('rte'); + } } $this->setFeature('dom'); $this->setFeature('iframes'); @@ -437,7 +438,7 @@ class Horde_Browser $this->setFeature('accesskey'); $this->setFeature('optgroup'); $this->setFeature('xmlhttpreq'); - $this->setFeature('dataurl'); + $this->setFeature('dataurl', 32768); break; case 7: @@ -597,7 +598,6 @@ class Horde_Browser } elseif (preg_match('|Mozilla/([0-9.]+)|', $agent, $version)) { $this->setBrowser('mozilla'); $this->setQuirk('must_cache_forms'); - $this->setFeature('dataurl'); list($this->_majorVersion, $this->_minorVersion) = explode('.', $version[1]); switch ($this->_majorVersion) { @@ -618,6 +618,9 @@ class Horde_Browser if ($revision[1] >= 1.3) { $this->setFeature('rte'); } + if (version_compare($revision[1], '1.8.1', '>=')) { + $this->setFeature('dataurl'); + } } break; -- 2.11.0