Skip to content

Commit ecc9393

Browse files
committed
Merge branch 'PHP-8.3' into PHP-8.4
2 parents 2b38384 + e13ba36 commit ecc9393

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ PHP NEWS
6060

6161
- Tidy:
6262
. Fix memory leak in tidy output handler on error. (nielsdos)
63+
. Fix tidyOptIsReadonly deprecation, using tidyOptGetCategory. (David Carlier)
6364

6465
06 Jun 2025, PHP 8.4.8
6566

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
@@ -234,7 +234,11 @@ static int _php_tidy_set_tidy_opt(TidyDoc doc, const char *optname, zval *value)
234234
return FAILURE;
235235
}
236236

237+
#if defined(HAVE_TIDYOPTGETCATEGORY)
238+
if (tidyOptGetCategory(opt) == TidyInternalCategory) {
239+
#else
237240
if (tidyOptIsReadOnly(opt)) {
241+
#endif
238242
php_error_docref(NULL, E_WARNING, "Attempting to set read-only option \"%s\"", optname);
239243
return FAILURE;
240244
}

0 commit comments

Comments
 (0)