diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2018-12-23 20:20:53 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2018-12-23 20:20:53 +0100 |
commit | 69f54dd549381945cb98b4bf88c1a8da8d81cc3e (patch) | |
tree | 6be6f4a23376547c1fd5a23a7c05ae116f0282c7 /ext/standard | |
parent | c4e46c3043b551365d0f318ceca16f1a36511ac8 (diff) | |
parent | 64de5bc224584e1da08c5c2bdf76db72ccbaaaab (diff) | |
download | php-git-69f54dd549381945cb98b4bf88c1a8da8d81cc3e.tar.gz |
Merge branch 'PHP-7.2' into PHP-7.3
Diffstat (limited to 'ext/standard')
-rw-r--r-- | ext/standard/browscap.c | 2 | ||||
-rw-r--r-- | ext/standard/tests/misc/browscap_no_default.ini | 2 | ||||
-rw-r--r-- | ext/standard/tests/misc/get_browser_no_default.phpt | 12 |
3 files changed, 15 insertions, 1 deletions
diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c index 8a2272fe00..4b4ef1b331 100644 --- a/ext/standard/browscap.c +++ b/ext/standard/browscap.c @@ -755,7 +755,7 @@ PHP_FUNCTION(get_browser) found_entry = zend_hash_str_find_ptr(bdata->htab, DEFAULT_SECTION_NAME, sizeof(DEFAULT_SECTION_NAME)-1); if (found_entry == NULL) { - efree(lookup_browser_name); + zend_string_release(lookup_browser_name); RETURN_FALSE; } } diff --git a/ext/standard/tests/misc/browscap_no_default.ini b/ext/standard/tests/misc/browscap_no_default.ini new file mode 100644 index 0000000000..81174a88d9 --- /dev/null +++ b/ext/standard/tests/misc/browscap_no_default.ini @@ -0,0 +1,2 @@ +[Firefox] +Browser="Firefox" diff --git a/ext/standard/tests/misc/get_browser_no_default.phpt b/ext/standard/tests/misc/get_browser_no_default.phpt new file mode 100644 index 0000000000..28e346af55 --- /dev/null +++ b/ext/standard/tests/misc/get_browser_no_default.phpt @@ -0,0 +1,12 @@ +--TEST-- +get_browser() without a default +--INI-- +browscap={PWD}/browscap_no_default.ini +--FILE-- +<?php + +var_dump(get_browser("")); + +?> +--EXPECT-- +bool(false) |