[Fixed]: bug in function add_hit [Fixed]: bug in function add_hit
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

[Fixed]: bug in function add_hit

Started by thomasFRU, November 18, 2008, 01:02:59 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

thomasFRU

I'm wondering, that the field for browser in db always contains 'Unknown'.

The reason is the code in function add_hit in the file include/functions.inc.php.

I changed the code from:

  $browser = 'Unknown';
        if(eregi("MSIE",$browser"])) {
            if(eregi("MSIE 5.5",$browser"])) {
                $browser = "Microsoft Internet Explorer 5.5";
            } else if(eregi("MSIE 6.0",$browser"])) {
                $browser = "Microsoft Internet Explorer 6.0";
            }
        } else if(eregi("Mozilla Firebird",$browser"])) {
            $browser = "Mozilla Firebird";
        } else if(eregi("netscape",$browser"])) {
            $browser = "Netscape";
        } else if(eregi("Firefox",$browser"])) {
            $browser = "Firefox";
        }

to:

  $browser = 'Unknown';
        if(eregi("MSIE",$_SERVER["HTTP_USER_AGENT"])) {
            if(eregi("MSIE 5.5",$_SERVER["HTTP_USER_AGENT"])) {
                $browser = "Microsoft Internet Explorer 5.5";
            } else if(eregi("MSIE 6.0",$_SERVER["HTTP_USER_AGENT"])) {
                $browser = "Microsoft Internet Explorer 6.0";
            }
        } else if(eregi("Mozilla Firebird",$_SERVER["HTTP_USER_AGENT"])) {
            $browser = "Mozilla Firebird";
        } else if(eregi("netscape",$_SERVER["HTTP_USER_AGENT"])) {
            $browser = "Netscape";
        } else if(eregi("Firefox",$_SERVER["HTTP_USER_AGENT"])) {
            $browser = "Firefox";
        }

and get meaningfull results in database



Paver

This has apparently been a problem since 1.4.9 due to a security fix implemented then (SVN revision 3132).

Fixed and committed to Subversion repository.  Will be in 1.4.21 and higher.