mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Fix GH-19021: improve tidyOptGetCategory detection
We now check both this symbol and TidyInternalCategory presence. Co-authored-by: Peter Kokot <peterkokot@gmail.com>
This commit is contained in:
committed by
Peter Kokot
parent
cf3b70d23c
commit
ebbb1b4295
4
NEWS
4
NEWS
@@ -64,6 +64,10 @@ PHP NEWS
|
||||
- Standard:
|
||||
. Fix shm corruption with coercion in options of unserialize(). (nielsdos)
|
||||
|
||||
- Tidy:
|
||||
. Fixed GH-19021 (improved tidyOptGetCategory detection).
|
||||
(arjendekorte, David Carlier, Peter Kokot)
|
||||
|
||||
- XMLReader:
|
||||
. Fix arginfo/zpp violations when LIBXML_SCHEMAS_ENABLED is not available.
|
||||
(nielsdos)
|
||||
|
||||
@@ -62,16 +62,32 @@ if test "$PHP_TIDY" != "no"; then
|
||||
AC_DEFINE(HAVE_TIDYRELEASEDATE,1,[ ])
|
||||
], [], [])
|
||||
|
||||
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,[ ])
|
||||
], [], [])
|
||||
|
||||
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
|
||||
TIDY_COMPILER_FLAGS="$TIDY_CFLAGS -Wno-ignored-qualifiers -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
|
||||
PHP_NEW_EXTENSION(tidy, tidy.c, $ext_shared,, $TIDY_COMPILER_FLAGS)
|
||||
|
||||
Reference in New Issue
Block a user