History log of /php-src/ext/simplexml/simplexml.c (Results 1 – 25 of 525)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 4bd63568 18-Jan-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix argument type of simplexml_import_dom (#13170)

It needs to be "object".
This is because first- and third-party extension can register custom
node types using `php_libxml_register

Fix argument type of simplexml_import_dom (#13170)

It needs to be "object".
This is because first- and third-party extension can register custom
node types using `php_libxml_register_export`. So we don't know upfront
what types can be expected.

This also changes the error to a TypeError everywhere.

show more ...


# 97267215 10-Jan-2024 David CARLIER

general signatures discrepencies fixes (#13122)


# 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.


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

Simplify php_sxe_count_elements_helper() by using non-destructive iterator reset


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

Use php_sxe_reset_iterator_no_clear_iter_data() to avoid having to store and restore iterator data

This makes the code less error-prone, and also makes it simpler.


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

Remove unnecessary _IS_BOOL case (#12230)

This can never be executed because booleans are handled in a special
case at the top of sxe_object_cast_ex().


# 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 ...


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

Simplify node check in simplexml


# 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.


# 05c46b71 13-Sep-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Small optimization in php_sxe_get_first_node() by avoiding unwrapping iterator data (#12194)


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

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

Closes GH-12165.


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

Remove useless SKIP_TEXT() invokes (#12164)

In the places I removed them, they were useless because there is already
a type check for a single node type, so I found it confusing having t

Remove useless SKIP_TEXT() invokes (#12164)

In the places I removed them, they were useless because there is already
a type check for a single node type, so I found it confusing having them
there.

show more ...


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

Preallocate result array size in simplexml xpath

This is the simplexml version of 4dea42a.


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

Remove obsolete libxml2 code

LIBXML2_NEW_BUFFER is always defined since libxml2 2.9.0.
That's the minimum version PHP requires, so it will always be defined.


# 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)


12345678910>>...21