diff --git a/etemplate/inc/class.html.inc.php b/etemplate/inc/class.html.inc.php index ae97f07508..d2a0da0d87 100644 --- a/etemplate/inc/class.html.inc.php +++ b/etemplate/inc/class.html.inc.php @@ -14,18 +14,22 @@ class html { + var $user_agent,$ua_version; var $prefered_img_title; function html() - { - global $HTTP_USER_AGENT; - // should be Ok for all HTML 4 compatible browsers - $this->prefered_img_title = stristr($HTTP_USER_AGENT,'konqueror') ? 'title' : 'alt'; + { // should be Ok for all HTML 4 compatible browsers + if (!eregi('compatible; ([a-z_]+)[/ ]+([0-9.]+)',$GLOBALS['HTTP_USER_AGENT'],$parts)) + eregi('^([a-z_]+)/([0-9.]+)',$GLOBALS['HTTP_USER_AGENT'],$parts); + list(,$this->user_agent,$this->ua_version) = $parts; + $this->user_agent = strtolower($this->user_agent); + $this->prefered_img_title = $this->user_agent == 'mozilla' && $this->ua_version < 5 ? 'ALT' : 'TITLE'; + //echo "
HTTP_USER_AGENT='$GLOBALS[HTTP_USER_AGENT]', UserAgent: '$this->user_agent', Version: '$this->ua_version', img_title: '$this->prefered_img_title'
\n"; } function div($content,$options='') { - return "