Bug #77338 [Com]: get_browser with empty string
| From: | emondpph at gmail dot com | Date: | Sat, 22 Dec 2018 23:19:39 +0000 |
| Subject: | Bug #77338 [Com]: get_browser with empty string | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-218574@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77338&edit=1
ID: 77338
Comment by: emondpph at gmail dot com
Reported by: emondpph at gmail dot com
Summary: get_browser with empty string
Status: Feedback
Type: Bug
Package: Reproducible crash
Operating System: Mac OS Mojave
PHP Version: 7.3.0
Block user comment: N
Private report: N
New Comment:
Here is what I get in the apache log when I run the script. For the backtrace, I don't know how
to get this done from my setup, sorry.
zend_mm_heap corrupted
Previous Comments:
------------------------------------------------------------------------
[2018-12-22 23:03:42] requinix@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php
for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php
for Win32
Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.
------------------------------------------------------------------------
[2018-12-22 23:02:57] emondpph at gmail dot com
Description:
------------
I noticed this bug while doing a batch of assertions on PHP 7.3.
get_browser('') will crash PHP.
In PHP 7.2 it would return an array.
Test script:
---------------
<?php
var_dump(get_browser(''));
?>
Expected result:
----------------
object(stdClass)#1 (10) { ["browser_name_regex"]=> string(6) "~^.*$~"
["browser_name_pattern"]=> string(1) "*" ["parent"]=> string(17)
"DefaultProperties" ["comment"]=> string(15) "Default Browser"
["browser"]=> string(15) "Default Browser" ["ismobiledevice"]=>
string(0) "" ["istablet"]=> string(0) "" ["version"]=>
string(3) "0.0" ["platform"]=> string(7) "unknown"
["device_type"]=> string(7) "unknown" }
Actual result:
--------------
Crash
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=77338&edit=1