WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: HITS- IE6 PNGFix] isIE6() bad detection (2 posts)

  1. TheGuit
    Member
    Posted 4 years ago #

    I propose a little change in isIE6() function of this plugin :

    // IE6 Check
    function isIE6()
    {
        $browser = 'mozilla';
        $majorVersion = 5;
    
        if(get_cfg_var('browscap')) {
            $browserTab = get_browser();
            $browser = strtolower($browserTab->browser);
            $majorVersion = intval($browserTab->majorver);
        }
        else {
            $userAgent = strtolower($_SERVER['HTTP_USER_AGENT']);
            if (preg_match('|msie ([0-9]).[0-9]{1,2}|',$userAgent,$matched)) {
                $browser = 'ie';
                $majorVersion = intval($matched[1]);
            }
        }
    
        if($this->options['hits_ie6_debug']=="true") {
            if(isset($userAgent)) {
                echo "\n<!-- DEBUG: HTTP_USER_AGENT='$userAgent' -->";
            }
            echo "\n<!-- DEBUG: DETECT BROWSER='$browser' -->";
            echo "\n<!-- DEBUG: DETECT M VERSION='$majorVersion' -->";
        }
    
        if($browser == 'ie' && $majorVersion <= 6) { // if IE<=6
            return true;
        }
        else { //if IE>6
            return false;
        }
    }

    Because on some computer the detection create nbad IE6 detection.

    Hope it could help.

    http://wordpress.org/extend/plugins/hits-ie6-pngfix/

  2. wpgwiggum
    Member
    Posted 4 years ago #

    hmmm, after investigating get_browser() at the php site, it looks like there are better performing alternatives. I will take a look, but there will be a fix for the next version.

Topic Closed

This topic has been closed to new replies.

About this Topic