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

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

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.