php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64809 Getting illegal characters at [browser_name_regex] rest all values are displayi
Submitted: 2013-05-10 06:05 UTC Modified: 2013-05-12 17:22 UTC
From: swapnesh20032003 at gmail dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.3.25 OS: Windows 7
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: swapnesh20032003 at gmail dot com
New email:
PHP Version: OS:

 

 [2013-05-10 06:05 UTC] swapnesh20032003 at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.get-browser#refsect1-function.get-browser-examples
---


Test script:
---------------
<?php
echo $_SERVER['HTTP_USER_AGENT'] . "\n\n";

$browser = get_browser(null, true);
echo "<pre>";
print_r($browser);
?>

More Information - http://stackoverflow.com/questions/16475256/getting-illegal-characters-in-get-browser-method-run-in-php


Expected result:
----------------
Expected output some thing like this instead of illegal characters- 

[browser_name_regex] => ^mozilla/5\.0 (windows; .; windows nt 5\.1; .*rv:.*) gecko/.* firefox/0\.9.*$

Current Output -

[browser_name_regex] => �^.*$�

Actual result:
--------------
Actual result I am getting(with illegal characters, rest all data is fine)

[browser_name_regex] => �^.*$�

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-05-11 09:05 UTC] ab@php.net
Please provide your browsercap.ini.
 [2013-05-11 09:05 UTC] ab@php.net
-Status: Open +Status: Feedback
 [2013-05-12 17:22 UTC] ab@php.net
-Status: Feedback +Status: Not a bug
 [2013-05-12 17:22 UTC] ab@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

What you see is merely a pcre pattern wrapped with delimiter which is \xA7. To get 
browsers matching you'll need a browscap.ini which is downloadable by the links on 
the doc page.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Mar 14 15:01:30 2025 UTC