php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68021 get_browser() browser_name_regex returns non-utf-8 characters
Submitted: 2014-09-15 21:54 UTC Modified: 2014-10-08 05:56 UTC
Votes:9
Avg. Score:3.4 ± 0.7
Reproduced:3 of 3 (100.0%)
Same Version:5 (166.7%)
Same OS:1 (33.3%)
From: justin at commando dot io Assigned:
Status: Closed Package: Unicode Engine related
PHP Version: 5.4.32 OS: CentOS 6.5
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: justin at commando dot io
New email:
PHP Version: OS:

 

 [2014-09-15 21:54 UTC] justin at commando dot io
Description:
------------
Calling get_browser() with a user-agent of:

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36

Returns non-utf8 characters in the `browser_name_regex` field. See:

stdClass Object ( [browser_name_regex] => �^mozilla/5\.0 \(.*mac os x 10_9.*\) applewebkit/.* \(khtml, like gecko\).*chrome/35\..*safari/.*$� 

This breaks json_decode() trying to store it.

Expected result:
----------------
Never return non-utf8 characters. This breaks json_decode();


Patches

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-10-08 05:56 UTC] justin at commando dot io
> This breaks json_decode() trying to store it.

Brain fart there, that should have been json_encode() trying to store it.
 [2015-03-23 05:14 UTC] stas@php.net
Automatic comment on behalf of datibbaw
Revision: http://git.php.net/?p=php-src.git;a=commit;h=5b5742c016a475cb20dcb9b8c19ba570a1110cf6
Log: Fixed #68021 - get_browser() browser_name_regex
 [2015-03-23 05:14 UTC] stas@php.net
-Status: Open +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 01:01:30 2024 UTC