Merge branch 'PHP-5.6' into PHP-7.0

This commit is contained in:
Christoph M. Becker 2016-08-27 01:13:32 +02:00
commit 8fcfacf746
3 changed files with 25 additions and 0 deletions

2
NEWS
View File

@ -72,6 +72,8 @@ PHP NEWS
. Fixed bug #55451 (substr_compare NULL length interpreted as 0). (Lauri
Kenttä)
. Fixed bug #72278 (getimagesize returning FALSE on valid jpg). (cmb)
. Fixed bug #65550 (get_browser() incorrectly parses entries with "+" sign).
(cmb)
- Streams:
. Fixed bug #72853 (stream_set_blocking doesn't work). (Laruence)

View File

@ -115,6 +115,10 @@ static void convert_browscap_pattern(zval *pattern, int persistent) /* {{{ */
t[j++] = '\\';
t[j] = '~';
break;
case '+':
t[j++] = '\\';
t[j] = '+';
break;
default:
t[j] = lc_pattern[i];
break;

View File

@ -0,0 +1,19 @@
--TEST--
Bug #65550 (get_browser() incorrectly parses entries with "+" sign)
--INI--
browscap={PWD}/browscap.ini
--SKIPIF--
<?php
if (!is_readable(ini_get('browscap'))) die('skip browscap.ini file ' . ini_get('browscap') . ' not readable');
?>
--FILE--
<?php
$user_agent = 'Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/522+ (KHTML, like Gecko, Safari/522) OmniWeb/v613';
$caps = get_browser($user_agent, true);
var_dump($caps['browser'], $caps['version']);
?>
==DONE==
--EXPECT--
string(7) "OmniWeb"
string(3) "5.6"
==DONE==