Skip to content

Commit fc30c0f

Browse files
committed
Merge branch 'PHP-7.3'
2 parents e595f5c + b1deb98 commit fc30c0f

File tree

2 files changed

+83
-2
lines changed

2 files changed

+83
-2
lines changed

ext/pcre/php_pcre.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@ PHPAPI pcre2_code *pcre_get_compiled_regex(zend_string *regex, uint32_t *capture
867867
pcre_cache_entry * pce = pcre_get_compiled_regex_cache(regex);
868868

869869
if (preg_options) {
870-
*preg_options = pce ? pce->preg_options : 0;
870+
*preg_options = 0;
871871
}
872872
if (capture_count) {
873873
*capture_count = pce ? pce->capture_count : 0;
@@ -884,7 +884,7 @@ PHPAPI pcre2_code* pcre_get_compiled_regex_ex(zend_string *regex, uint32_t *capt
884884
pcre_cache_entry * pce = pcre_get_compiled_regex_cache(regex);
885885

886886
if (preg_options) {
887-
*preg_options = pce ? pce->preg_options : 0;
887+
*preg_options = 0;
888888
}
889889
if (compile_options) {
890890
*compile_options = pce ? pce->compile_options : 0;

ext/standard/tests/misc/bug77338.phpt

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
--TEST--
2+
Bug #77338: get_browser with empty string
3+
--INI--
4+
browscap={PWD}/browscap.ini
5+
--FILE--
6+
<?php
7+
8+
var_dump(get_browser(""));
9+
10+
?>
11+
--EXPECT--
12+
object(stdClass)#1 (34) {
13+
["browser_name_regex"]=>
14+
string(6) "~^.*$~"
15+
["browser_name_pattern"]=>
16+
string(1) "*"
17+
["browser"]=>
18+
string(15) "Default Browser"
19+
["version"]=>
20+
string(1) "0"
21+
["majorver"]=>
22+
string(1) "0"
23+
["minorver"]=>
24+
string(1) "0"
25+
["platform"]=>
26+
string(7) "unknown"
27+
["alpha"]=>
28+
string(0) ""
29+
["beta"]=>
30+
string(0) ""
31+
["win16"]=>
32+
string(0) ""
33+
["win32"]=>
34+
string(0) ""
35+
["win64"]=>
36+
string(0) ""
37+
["frames"]=>
38+
string(1) "1"
39+
["iframes"]=>
40+
string(0) ""
41+
["tables"]=>
42+
string(1) "1"
43+
["cookies"]=>
44+
string(0) ""
45+
["backgroundsounds"]=>
46+
string(0) ""
47+
["authenticodeupdate"]=>
48+
string(1) "0"
49+
["cdf"]=>
50+
string(0) ""
51+
["vbscript"]=>
52+
string(0) ""
53+
["javaapplets"]=>
54+
string(0) ""
55+
["javascript"]=>
56+
string(0) ""
57+
["activexcontrols"]=>
58+
string(0) ""
59+
["stripper"]=>
60+
string(0) ""
61+
["isbanned"]=>
62+
string(0) ""
63+
["wap"]=>
64+
string(0) ""
65+
["ismobiledevice"]=>
66+
string(0) ""
67+
["issyndicationreader"]=>
68+
string(0) ""
69+
["crawler"]=>
70+
string(0) ""
71+
["css"]=>
72+
string(1) "0"
73+
["cssversion"]=>
74+
string(1) "0"
75+
["supportscss"]=>
76+
string(0) ""
77+
["aol"]=>
78+
string(0) ""
79+
["aolversion"]=>
80+
string(1) "0"
81+
}

0 commit comments

Comments
 (0)