From b3f483db2e371d558708f750edf1ad56ca1065d7 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Thu, 21 Dec 2023 17:37:05 +0100 Subject: [PATCH] Fix GH-12980: tidynode.props.attribute is missing "Boolean Attributes" and empty attributes Closes GH-12993. --- NEWS | 4 ++++ ext/tidy/tests/gh12980.phpt | 34 ++++++++++++++++++++++++++++++++++ ext/tidy/tidy.c | 8 ++++++-- 3 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 ext/tidy/tests/gh12980.phpt diff --git a/NEWS b/NEWS index e74c11bafc6..c68a4d19740 100644 --- a/NEWS +++ b/NEWS @@ -46,6 +46,10 @@ PHP NEWS . Fix getting the address of an uninitialized property of a SimpleXMLElement resulting in a crash. (nielsdos) +- Tidy: + . Fixed bug GH-12980 (tidynode.props.attribute is missing + "Boolean Attributes" and empty attributes). (nielsdos) + 21 Dec 2023, PHP 8.2.14 - Core: diff --git a/ext/tidy/tests/gh12980.phpt b/ext/tidy/tests/gh12980.phpt new file mode 100644 index 00000000000..042701388a4 --- /dev/null +++ b/ext/tidy/tests/gh12980.phpt @@ -0,0 +1,34 @@ +--TEST-- +GH-12980 (tidynode.props.attribute is missing "Boolean Attributes" and empty attributes) +--EXTENSIONS-- +tidy +--FILE-- +'; + +$tidy = new tidy(); +$tidy->ParseString($html); +echo tidy_get_output($tidy), "\n"; + +var_dump($tidy->root()->child[1]->attribute); + +?> +--EXPECT-- + + +
+