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

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

    Details

    • Type: Improvement
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 3.0.11
    • Fix Version/s: 3.0.15-RC1
    • Component/s: ACP
    • Labels:
      None
    • Environment:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: