Skip to content

Commit a1c899a

Browse files
committed
tidyOptIsReadOnly is deprecated, using its replacement when possible.
1 parent 4afe3bc commit a1c899a

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

ext/tidy/config.m4

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ if test "$PHP_TIDY" != "no"; then
5757
[],
5858
[-L$TIDY_LIBDIR])
5959

60+
PHP_CHECK_LIBRARY([$TIDY_LIB_NAME], [tidyOptGetCategory],
61+
[AC_DEFINE([HAVE_TIDYOPTGETCATEGORY], [1],
62+
[Define to 1 if Tidy library has the 'tidyOptGetCategory' function.])],
63+
[],
64+
[-L$TIDY_LIBDIR])
65+
6066
PHP_ADD_LIBRARY_WITH_PATH([$TIDY_LIB_NAME],
6167
[$TIDY_LIBDIR],
6268
[TIDY_SHARED_LIBADD])

ext/tidy/tidy.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,11 @@ static int _php_tidy_set_tidy_opt(TidyDoc doc, const char *optname, zval *value,
233233
return FAILURE;
234234
}
235235

236+
#if defined(HAVE_TIDYOPTGETCATEGORY)
237+
if (tidyOptGetCategory(opt) == TidyInternalCategory) {
238+
#else
236239
if (tidyOptIsReadOnly(opt)) {
240+
#endif
237241
zend_argument_value_error(arg, "Attempting to set read-only option \"%s\"", optname);
238242
return FAILURE;
239243
}

0 commit comments

Comments
 (0)