Advanced search  

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]

Pages: [1]   Go Down

Author Topic: [Fixed]: bug in function add_hit  (Read 25838 times)

0 Members and 1 Guest are viewing this topic.

thomasFRU

  • Contributor
  • Coppermine newbie
  • ***
  • Offline Offline
  • Posts: 14
    • www.uledoc.de
[Fixed]: bug in function add_hit
« on: November 18, 2008, 01:02:59 am »

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


« Last Edit: March 03, 2009, 12:13:43 am by Paver »
Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1608
  • Paul Van Rompay
Re: [Fixed]: bug in function add_hit
« Reply #1 on: March 03, 2009, 12:15:29 am »

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.
Logged
Pages: [1]   Go Up
 

Page created in 0.016 seconds with 20 queries.