Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-11080

Send statistical information: user_agent: Version not accurate for (at least) Opera

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Won't Fix
    • 3.0.11
    • 3.0.15-RC1
    • ACP
    • None
    • PHP 5.3.8

    Description

      In /includes/questionnaire/questionnaire.php the user agent is recognized as:

      			if (preg_match('#(' . $agent . ')[/ ]?([0-9.]*)#i', $user_agent, $match))
      			{
      $aMatchOpera ) ) $match[2]= $aMatchOpera[1];
      				$result['user_agent'] = $match[1] . ' ' . $match[2];
      				break;
      			}


      However, this will always bring up Opera/9.80 for Opera browsers although the version is higher for many years already. A typical user agent for Opera is:

      Opera/9.80 (Windows NT 5.1; U; en) Presto/2.10.289 Version/12.01


      So a more accurate code would be to pull the version component for the statistics:

      			if (preg_match('#(' . $agent . ')[/ ]?([0-9.]*)#i', $user_agent, $match))
      			{
      				if( preg_match( '#opera/[0-9].+version/([0-9.]*)#i', $user_agent, $aMatchOpera ) ) $match[2]= $aMatchOpera[1];
      				$result['user_agent'] = $match[1] . ' ' . $match[2];
      				break;
      			}

      Attachments

        Activity

          People

            CHItA CHItA
            AmigoJack AmigoJack
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: