History log of /PHP-8.3/ext/simplexml/simplexml.c (Results 1 – 25 of 491)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# b5834c12 11-Sep-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix GH-15837: Segmentation fault in ext/simplexml/simplexml.c

We should check if the iterator data is still valid, because if it
isn't, then the type info is UNDEF, but the pointer value

Fix GH-15837: Segmentation fault in ext/simplexml/simplexml.c

We should check if the iterator data is still valid, because if it
isn't, then the type info is UNDEF, but the pointer value may be
dangling.

Closes GH-15841.

show more ...


# 2edf12e8 23-Jun-2024 David Carlier

Fix GH-14638: null dereference after XML parsing failure.

object document is null if the parsing had failed prior to cast to
string.


# f75931ad 12-Dec-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix GH-12929: SimpleXMLElement with stream_wrapper_register can segfault

Move SimpleXML invalidation code after node checks

This is safe, i.e. the tree hasn't been modified yet, bec

Fix GH-12929: SimpleXMLElement with stream_wrapper_register can segfault

Move SimpleXML invalidation code after node checks

This is safe, i.e. the tree hasn't been modified yet, because either we
didn't call a libxml modification function yet, or xmlNewChild is called
with a NULL pointer, which makes it bail out and return NULL.

Closes GH-12947.

show more ...


# abf4c116 12-Dec-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix getting the address of an uninitialized property of a SimpleXMLElement resulting in a crash

Closes GH-12945.


# b842ea4f 28-Sep-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Apply SimpleXML iterator fixes only on master

Many methods in SimpleXML reset the iterator when called. This has the
consequence that mixing these operations with loops can cause infinit

Apply SimpleXML iterator fixes only on master

Many methods in SimpleXML reset the iterator when called. This has the
consequence that mixing these operations with loops can cause infinite
loops, or the loss of iteration data.
Some people may however rely on the resetting behaviour. To prevent
unintended breaks in stable branches, let's only apply the fix to master.

This reverts GH-12193, GH-12229, GG-12247 for stable branches while
keeping them on master, adding a note in UPGRADING as well.

show more ...


# 82a84d0b 23-Sep-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix GH-12167 and GH-12169: Unable to get comment or processing instruction contents in SimpleXML

Closes GH-12289.


# 1a4e401b 19-Sep-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix bug #55098: SimpleXML iteration produces infinite loop

Closes GH-12247.


# 486276f0 17-Sep-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix GH-12208: SimpleXML infinite loop when a cast is used inside a foreach

Closes GH-12229.


# 39a9e561 16-Sep-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix GH-12223: Entity reference produces infinite loop in var_dump/print_r

Closes GH-12223.


# 4d888cf5 12-Sep-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix GH-12192: SimpleXML infinite loop when getName() is called within foreach

This happens because getName() resets the iterator to the start because
it overwrites the iterator data.

Fix GH-12192: SimpleXML infinite loop when getName() is called within foreach

This happens because getName() resets the iterator to the start because
it overwrites the iterator data.
We add a version of get_first_node that does not overwrite the iterator
data.

Closes GH-12193.

show more ...


# 747335f1 11-Sep-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix GH-12170: Can't use xpath with comments in SimpleXML

Closes GH-12177.


# 107443b3 09-Sep-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix #52751: XPath processing-instruction() function is not supported.

Closes GH-12165.


# efc73f24 07-Aug-2023 Ilija Tovilo

Revert "Call cast_object handler from get_properties_for"

This reverts commit 4182813ebffe0570e3741debd7da543df3517d0d.


# c283c3ab 15-Jul-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Sanitize libxml2 globals before parsing

Fixes GHSA-3qrf-m4j2-pcrr.

To parse a document with libxml2, you first need to create a parsing context.
The parsing context contains par

Sanitize libxml2 globals before parsing

Fixes GHSA-3qrf-m4j2-pcrr.

To parse a document with libxml2, you first need to create a parsing context.
The parsing context contains parsing options (e.g. XML_NOENT to substitute
entities) that the application (in this case PHP) can set.
Unfortunately, libxml2 also supports providing default set options.
For example, if you call xmlSubstituteEntitiesDefault(1) then the XML_NOENT
option will be added to the parsing options every time you create a parsing
context **even if the application never requested XML_NOENT**.

Third party extensions can override these globals, in particular the
substitute entity global. This causes entity substitution to be
unexpectedly active.

Fix it by setting the parsing options to a sane known value.
For API calls that depend on global state we introduce
PHP_LIBXML_SANITIZE_GLOBALS() and PHP_LIBXML_RESTORE_GLOBALS().
For other APIs that work directly with a context we introduce
php_libxml_sanitize_parse_ctxt_options().

show more ...


# 4182813e 30-Jun-2023 Ilija Tovilo

Call cast_object handler from get_properties_for

Fixes GH-11547
Closes GH-11583


# dda42be9 26-Jun-2023 Vuudi <35967974+Vuudi@users.noreply.github.com>

[skip ci] Fixed comment for SimpleXml function getName (#11537)

Co-authored-by: David Huang <david.huang@check24.de>


# d5ad7510 08-Jun-2023 George Peter Banyard

More usage of known zend_str instead of C string (#11381)


# ed097e30 02-Jun-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

No need for the double name pointer


# 47c277bd 02-Jun-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Use xmlStrEqual() instead of !xmlStrCmp()

This actually shows the intent clearer, and also from the docs of
xmlStrEqual:
"Should be a bit more readable and faster than xmlStrcmp()".


# 79512794 02-Jun-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Remove double class entry variable


# c6bffff9 02-Jun-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Remove dead code from sxe_get_element_by_name()

retnode will never be set to anything other than NULL, because the
branch is always taken if the names match.


# c3f07973 02-Jun-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Implement iteration cache, item cache and length cache for node list iteration (#11330)

* Implement iteration cache, item cache and length cache for node list iteration

The current

Implement iteration cache, item cache and length cache for node list iteration (#11330)

* Implement iteration cache, item cache and length cache for node list iteration

The current implementation follows the spec requirement that the list
must be "live". This means that changes in the document must be
reflected in the existing node lists without requiring the user to
refetch the node list.
The consequence is that getting any item, or the length of the list,
always starts searching from the root element of the node list. This
results in O(n) time to get any item or the length. If there's a for
loop over the node list, this means the iterations will take O(n²) time
in total. This causes real-world performance issues with potential for
downtime (see GH-11308 and its references for details).

We fix this by introducing a caching strategy. We cache the last
iterated object in the iterator, the last requested item in the node
list, and the last length computation. To invalidate the cache, we
simply count the number of modifications made to the containing
document. If the modification number does not match what the number was
during caching, we know the document has been modified and the cache is
invalid. If this ever overflows, we saturate the modification number and
don't do any caching anymore. Note that we don't check for overflow on
64-bit systems because it would take hundreds of years to overflow.

Fixes GH-11308.

show more ...


# 7936c808 23-Jan-2023 Máté Kocsis

Fix GH-8329 Print true/false instead of bool in error and debug messages (#8385)


# a01dd9fe 14-Sep-2022 Bob Weinand

Revert "Port all internally used classes to use default_object_handlers"

This reverts commit 94ee4f9834743ca74f6c9653863273277ce6c61a.

The commit was a bit too late to be included i

Revert "Port all internally used classes to use default_object_handlers"

This reverts commit 94ee4f9834743ca74f6c9653863273277ce6c61a.

The commit was a bit too late to be included in PHP 8.2 RC1. Given it's a massive ABI break, we decide to postpone the change to PHP 8.3.

show more ...


Revision tags: php-8.2.0RC1, php-8.1.10, php-8.0.23
# 94ee4f98 24-Aug-2022 Bob Weinand

Port all internally used classes to use default_object_handlers

Signed-off-by: Bob Weinand <bobwei9@hotmail.com>


12345678910>>...20