March 22, 2010, 02:19:43 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Announcing Coppermine 1.5.3 Release Candidate
It is with great joy that we present Coppermine 1.5.3 [RC]. After over 2 years of work and thousands of lines of code we now have a superb and feature packed product. It has been a long and challenging journey but with the help of you, the community, and our team of dedicated supporters and developers we are almost there.
[more]
   Home   Help Search Board rules Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: [Fixed]: bug in function add_hit  (Read 5571 times)
0 Members and 1 Guest are viewing this topic.
thomasFRU Topic starter
Contributor
***
Posts: 6


WWW
« on: November 18, 2008, 12: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 02, 2009, 11:13:43 pm by Paver » Logged
Paver
Dev Team member
****
Gender: Male
United States United States

Posts: 1606


Paul Van Rompay


« Reply #1 on: March 02, 2009, 11:15:29 pm »

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
  Print  
 
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC
Page created in 0.049 seconds with 15 queries.