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