From e915ed75ea8c8fd199eb7892efa1ce56d5ee5641 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Wed, 28 Aug 2024 17:08:30 +0200 Subject: [PATCH] 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. --- NEWS | 3 +++ win32/build/confutils.js | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 3987f73f801..d46c2514dde 100644 --- a/NEWS +++ b/NEWS @@ -71,6 +71,9 @@ PHP NEWS . Fixed bug GH-15169 (stack overflow when var serialization in ext/standard/var). (nielsdos) +- Windows: + . Fixed bug GH-16199 (GREP_HEADER() is broken). (Peter Kokot) + 26 Sep 2024, PHP 8.4.0RC1 - BcMath: diff --git a/win32/build/confutils.js b/win32/build/confutils.js index 2fba54c0b4d..1a4ddbffaa9 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -965,14 +965,19 @@ function GREP_HEADER(header_name, regex, path_to_check) if (!c) { /* 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"); if (typeof(p) == "string") { - c = file_get_contents(p); + c = file_get_contents(p + "\\" + header_name); } else if (p == false) { p = search_paths(header_name, PHP_EXTRA_INCLUDES, null); if (typeof(p) == "string") { - c = file_get_contents(p); + c = file_get_contents(p + "\\" + header_name); } } if (!c) {