Advanced search  

News:

cpg1.5.22 maintenance release - upgrade recommended
The Coppermine development team is releasing an update for Coppermine in order to fix several minor issues. All fixes are not security critical, so if your gallery is running fine with cpg1.5.20 you don't need to upgrade. If you are running an older version than cpg1.5.20, you must update to this latest version as soon as possible because of the security impact!
[more]

Pages: [1]   Go Down

Author Topic: [Fixed]: bug in function add_hit  (Read 15421 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, 02: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, 01:13:43 am by Paver »
Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1606
  • Paul Van Rompay
Re: [Fixed]: bug in function add_hit
« Reply #1 on: March 03, 2009, 01: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.177 seconds with 21 queries.