Bug #77338 [NEW]: get_browser with empty string
From: emondpph at gmail dot com
Operating system: Mac OS Mojave
PHP version: 7.3.0
Package: Reproducible crash
Bug Type: Bug
Bug description:get_browser with empty string
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 bug report at https://bugs.php.net/bug.php?id=77338&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=77338&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=77338&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=77338&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=77338&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=77338&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=77338&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=77338&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=77338&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=77338&r=support
Expected behavior: https://bugs.php.net/fix.php?id=77338&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=77338&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=77338&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=77338&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77338&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=77338&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=77338&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=77338&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=77338&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=77338&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=77338&r=mysqlcfg
Thread (10 messages)
- emondpph at gmail dot com