BUG 0000 PHP 5.2.x compatibility on G::getBrowser() func..

- fix for php version compatibility
This commit is contained in:
Erik Amaru Ortiz
2012-02-28 18:40:16 -04:00
parent e3e5537618
commit d371fc6982

View File

@@ -4456,11 +4456,8 @@ function get_mobile_data( $pv_browser_user_agent )
// finally get the correct version number
$known = array('Version', $ub, 'other');
$pattern = '#(?<browser>' . join('|', $known) .
')[/ ]+(?<version>[0-9.|a-zA-Z.]*)#';
if (!preg_match_all($pattern, $u_agent, $matches)) {
// we have no matching number just continue
}
$pattern = '#(?P<browser>' . join('|', $known) . ')[/ ]+(?P<version>[0-9.|a-zA-Z.]*)#';
@preg_match_all($pattern, $u_agent, $matches);
// see how many we have
$i = count($matches['browser']);