Fix GH-16199: GREP_HEADER() is broken

This also fixes the libxml version check when the libxml/xmlversion.h
is located elsewhere than libxml2 include directory.

Closes GH-15619.
This commit is contained in:
Peter Kokot 2024-08-28 17:08:30 +02:00 committed by Christoph M. Becker
parent 50dfc436cd
commit e915ed75ea
No known key found for this signature in database
GPG key ID: D66C9593118BCCB6
2 changed files with 10 additions and 2 deletions

3
NEWS
View file

@ -71,6 +71,9 @@ PHP NEWS
. Fixed bug GH-15169 (stack overflow when var serialization in . Fixed bug GH-15169 (stack overflow when var serialization in
ext/standard/var). (nielsdos) ext/standard/var). (nielsdos)
- Windows:
. Fixed bug GH-16199 (GREP_HEADER() is broken). (Peter Kokot)
26 Sep 2024, PHP 8.4.0RC1 26 Sep 2024, PHP 8.4.0RC1
- BcMath: - BcMath:

View file

@ -965,14 +965,19 @@ function GREP_HEADER(header_name, regex, path_to_check)
if (!c) { if (!c) {
/* look in the include path */ /* look in the include path */
if (path_to_check == null) {
path_to_check = php_usual_include_suspects;
} else {
path_to_check += ";" + php_usual_include_suspects;
}
var p = search_paths(header_name, path_to_check, "INCLUDE"); var p = search_paths(header_name, path_to_check, "INCLUDE");
if (typeof(p) == "string") { if (typeof(p) == "string") {
c = file_get_contents(p); c = file_get_contents(p + "\\" + header_name);
} else if (p == false) { } else if (p == false) {
p = search_paths(header_name, PHP_EXTRA_INCLUDES, null); p = search_paths(header_name, PHP_EXTRA_INCLUDES, null);
if (typeof(p) == "string") { if (typeof(p) == "string") {
c = file_get_contents(p); c = file_get_contents(p + "\\" + header_name);
} }
} }
if (!c) { if (!c) {