1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00

Merge branch 'PHP-8.4' into PHP-8.5

* PHP-8.4:
  Fix GH-19021: improve tidyOptGetCategory detection
This commit is contained in:
Peter Kokot
2025-10-19 20:54:55 +02:00
2 changed files with 27 additions and 8 deletions

4
NEWS
View File

@@ -39,6 +39,10 @@ PHP NEWS
exposes INDIRECTs). (nielsdos)
. Improve __unserialize() hardening for SplHeap/SplPriorityQueue. (nielsdos)
- Tidy:
. Fixed GH-19021 (improved tidyOptGetCategory detection).
(arjendekorte, David Carlier, Peter Kokot)
- URI:
. Fixed bug GH-20088 (Heap-use-after-free in PHP URI WHATWG parser
during malformed URL processing). (lexborisov)

View File

@@ -57,19 +57,34 @@ if test "$PHP_TIDY" != "no"; then
[],
[-L$TIDY_LIBDIR])
dnl The tidyOptGetCategory function (added in libtidy 5.4.0) if only useable
dnl if TidyInternalCategory (added in libtidy 5.6.0) is also present.
PHP_CHECK_LIBRARY([$TIDY_LIB_NAME], [tidyInternalCategory],
[AC_DEFINE([HAVE_TIDYOPTGETCATEGORY], [1],
[Define to 1 if Tidy library has the 'tidyOptGetCategory' function.])],
[],
[-L$TIDY_LIBDIR])
PHP_ADD_LIBRARY_WITH_PATH([$TIDY_LIB_NAME],
[$TIDY_LIBDIR],
[TIDY_SHARED_LIBADD])
PHP_ADD_INCLUDE([$TIDY_INCDIR])
old_CPPFLAGS=$CPPFLAGS
CPPFLAGS=-I$TIDY_INCDIR
dnl The tidyOptGetCategory function (added in tidy-html5 5.4.0) is only
dnl useable if TidyInternalCategory (added in tidy-html5 5.6.0) is also
dnl present.
AC_CACHE_CHECK([for tidyOptGetCategory], [php_ac_cv_have_tidyoptgetcategory],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <tidy.h>],[
TidyDoc doc = tidyCreate();
TidyOption badopt = tidyGetOptionByName(doc, "<bad>");
Bool v = (tidyOptGetCategory(badopt) == TidyInternalCategory);
(void)v;
tidyRelease(doc);
])],
[php_ac_cv_have_tidyoptgetcategory=yes],
[php_ac_cv_have_tidyoptgetcategory=no])
])
AS_VAR_IF([php_ac_cv_have_tidyoptgetcategory], [yes],
[AC_DEFINE([HAVE_TIDYOPTGETCATEGORY], [1],
[Define to 1 if tidyOptGetCategory is available.])])
CPPFLAGS=$old_CPPFLAGS
dnl Add -Wno-ignored-qualifiers as this is an issue upstream. Fixed in
dnl tidy-html5 5.7.20: https://github.com/htacg/tidy-html5/issues/866
PHP_NEW_EXTENSION([tidy],