History log of /php-src/ext/xsl/xsltprocessor.c (Results 1 – 25 of 191)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 30885f3b 31-Mar-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Implement request #71571: XSLT processor should provide option to change maxDepth (#13731)

There are two depth limiting parameters for XSLT templates.
1) maxTemplateDepth
This cor

Implement request #71571: XSLT processor should provide option to change maxDepth (#13731)

There are two depth limiting parameters for XSLT templates.
1) maxTemplateDepth
This corresponds to the recursion depth of a template. For very
complicated templates this can be hit.
2) maxTemplateVars
This is the total number of live variables. When using recursive
templates with lots of parameters you can hit this limit.

This patch introduces two new properties to XSLTProcessor that
corresponds to the above variables.

show more ...


# e1630381 20-Mar-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix GH-13764: xsl cannot build on PHP 8.4 (#13770)

Move some of the DOM APIs from the non-public php_dom.h header to the
public header xml_common.h.


# 14b6c981 09-Mar-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

[RFC] Add a way to opt-in ext/dom spec compliance (#13031)

RFC: https://wiki.php.net/rfc/opt_in_dom_spec_compliance


# ad29afd4 24-Feb-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Document xsl:keys handling better in ext/xsl


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


# 76a3eddf 17-Jan-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Field cleanups in xsl_object (#13182)


# 90785dd8 12-Jan-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

[RFC] Improve callbacks in ext/dom and ext/xsl (#12627)


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

Backport deprecation warning ignores to unbreak CI

In master I use ZEND_DIAGNOSTIC_IGNORED_START, but that doesn't exist on
8.2 or 8.3 (8.3 has a similar macro though).
So to unbreak

Backport deprecation warning ignores to unbreak CI

In master I use ZEND_DIAGNOSTIC_IGNORED_START, but that doesn't exist on
8.2 or 8.3 (8.3 has a similar macro though).
So to unbreak CI I just made a variation of this directly in the
php_libxml.h header.

See https://github.com/php/php-src/commit/683e78786070ab77d33f7787598ac1b90d68390a#commitcomment-134301083

Closes GH-12887.

show more ...


# 20c9c4a3 02-Nov-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix validation logic of php:function() callbacks in dom and xsl

Two issues:
- Assumed that at least 1 argument (function name) was provided.
- Incorrect error path for the non-callab

Fix validation logic of php:function() callbacks in dom and xsl

Two issues:
- Assumed that at least 1 argument (function name) was provided.
- Incorrect error path for the non-callable case.

Closes GH-12593.

show more ...


# 3bb56ae4 06-Oct-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Add missing properties to xsl stub (#12334)

* Define doXInclude for XSLTProcessor, and test the property

This was added in 8d1427dd98, but never defined on the stub.
It was more

Add missing properties to xsl stub (#12334)

* Define doXInclude for XSLTProcessor, and test the property

This was added in 8d1427dd98, but never defined on the stub.
It was more or less fine when dynamic properties were not deprecated,
but now they throw a deprecation warning. To fix it, define on the stub.
This should also help discoverability of the functionality.

* Define cloneDocument for XSLTProcessor, and test the property

This was introduced in 5c039bbad9, but never defined on the stub.
It was more or less fine when dynamic properties were not deprecated,
but now they throw a deprecation warning. To fix it, define on the stub.
This should also help discoverability of the functionality.

show more ...


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

Improve error messages for XSLTProcessor::transformToDoc() (#12332)

* Improve error messages for XSLTProcessor::transformToDoc()

Also adds a relevant test file, as these branches we

Improve error messages for XSLTProcessor::transformToDoc() (#12332)

* Improve error messages for XSLTProcessor::transformToDoc()

Also adds a relevant test file, as these branches were untested before.

show more ...


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

Use RETURN_STR_COPY() in xsl

Everything in intern->parameter is already a string.


# 5c749ad4 30-Sep-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Implement request #64137 (XSLTProcessor::setParameter() should allow both quotes to be used)

This reimplements the parameter handling. Instead of quoting the strings
manually, adding the

Implement request #64137 (XSLTProcessor::setParameter() should allow both quotes to be used)

This reimplements the parameter handling. Instead of quoting the strings
manually, adding them to an array, and passing that as input; use the
libxslt API to pass data verbatim to the processor.
This also simplifies the code a lot.

Closes GH-12331.

show more ...


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


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

Use zval_ptr_dtor_nogc() for callable in ext/xslt (#11356)

It cannot contain cycles because it's either a string or an array with 2 strings.


# 9d5f2f13 20-Mar-2023 Ilija Tovilo

Use new ZSTR_INIT_LITERAL macro (#10879)


# 1925855c 14-Jan-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix bug 69168: DomNode::getNodePath() returns invalid path

Upon freeing libxslt's context, every document which is not the *main*
document will be freed by libxslt. If a node of a docume

Fix bug 69168: DomNode::getNodePath() returns invalid path

Upon freeing libxslt's context, every document which is not the *main*
document will be freed by libxslt. If a node of a document which is not
the main document gets returned to userland, we'd free the node twice:
- first by the cleanup of the xslt context
- and then by our own refcounting mechanism.
This was reported in bug 49634, and was fixed by always copying the
node (and later re-fixed in bug 70078).
The original fix is not entirely correct unfortunately because of the
following two main reasons:
- modifications to the node will only modify the copy, and not the original
- accesses to the parent, path, ... will not work

This patch fixes it properly by only copying the node if it origins from
a document other than the main document.

Co-authored-by: juha.ikavalko@agentit.fi

Closes GH-10318.

show more ...


Revision tags: php-8.2.0RC1, php-8.1.10, php-8.0.23, php-8.0.23RC1, php-8.1.10RC1, php-8.2.0beta3, php-8.2.0beta2, php-8.1.9, php-8.0.22, php-8.1.9RC1, php-8.2.0beta1, php-8.0.22RC1, php-8.0.21, php-8.1.8, php-8.2.0alpha3, php-8.1.8RC1, php-8.2.0alpha2, php-8.0.21RC1, php-8.0.20, php-8.1.7, php-8.2.0alpha1, php-7.4.30, php-8.1.7RC1, php-8.0.20RC1, php-8.1.6, php-8.0.19, php-8.1.6RC1, php-8.0.19RC1, php-8.0.18, php-8.1.5, php-7.4.29, php-8.1.5RC1, php-8.0.18RC1, php-8.1.4, php-8.0.17, php-8.1.4RC1, php-8.0.17RC1, php-8.1.3, php-8.0.16, php-7.4.28, php-8.1.3RC1, php-8.0.16RC1, php-8.1.2, php-8.0.15, php-8.1.2RC1, php-8.0.15RC1, php-8.0.14, php-8.1.1, php-7.4.27, php-8.1.1RC1, php-8.0.14RC1, php-7.4.27RC1, php-8.1.0, php-8.0.13, php-7.4.26, php-7.3.33, php-8.1.0RC6
# 90b7bde6 03-Nov-2021 Dmitry Stogov

Use more compact representation for packed arrays.

- for packed arrays we store just an array of zvals without keys.
- the elements of packed array are accessible throuf as ht->arPacked[

Use more compact representation for packed arrays.

- for packed arrays we store just an array of zvals without keys.
- the elements of packed array are accessible throuf as ht->arPacked[i]
instead of ht->arData[i]
- in addition to general ZEND_HASH_FOREACH_* macros, we introduced similar
familied for packed (ZEND_HASH_PACKED_FORECH_*) and real hashes
(ZEND_HASH_MAP_FOREACH_*)
- introduced an additional family of macros to access elements of array
(packed or real hashes) ZEND_ARRAY_ELEMET_SIZE, ZEND_ARRAY_ELEMET_EX,
ZEND_ARRAY_ELEMET, ZEND_ARRAY_NEXT_ELEMENT, ZEND_ARRAY_PREV_ELEMENT
- zend_hash_minmax() prototype was changed to compare only values

Because of smaller data set, this patch may show performance improvement
on some apps and benchmarks that use packed arrays. (~1% on PHP-Parser)

TODO:
- sapi/phpdbg needs special support for packed arrays (WATCH_ON_BUCKET).
- zend_hash_sort_ex() may require converting packed arrays to hash.

show more ...

Revision tags: php-7.4.26RC1, php-8.0.13RC1, php-8.1.0RC5, php-7.3.32, php-7.4.25, php-8.0.12, php-8.1.0RC4, php-8.0.12RC1, php-7.4.25RC1, php-8.1.0RC3, php-8.0.11, php-7.4.24, php-7.3.31, php-8.1.0RC2, php-7.4.24RC1, php-8.0.11RC1
# e41f7e59 01-Sep-2021 Nikita Popov

Simplify handler invocation in xsltprocessor

Revision tags: php-8.1.0RC1, php-7.4.23, php-8.0.10, php-7.3.30, php-8.1.0beta3, php-8.0.10RC1, php-7.4.23RC1, php-8.1.0beta2, php-8.0.9, php-7.4.22, php-8.1.0beta1, php-7.4.22RC1, php-8.0.9RC1, php-8.1.0alpha3, php-7.4.21, php-7.3.29
# aff36587 29-Jun-2021 Patrick Allaert

Fixed some spaces used instead of tabs

Revision tags: php-8.0.8, php-8.1.0alpha2, php-7.4.21RC1, php-8.0.8RC1, php-8.1.0alpha1, php-8.0.7, php-7.4.20, php-8.0.7RC1, php-7.4.20RC1
# 01b3fc03 06-May-2021 KsaR

Update http->https in license (#6945)

1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as

Update http->https in license (#6945)

1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |

show more ...

Revision tags: php-8.0.6, php-7.4.19, php-7.4.18, php-7.3.28, php-8.0.5, php-8.0.5RC1, php-7.4.18RC1, php-8.0.4RC1, php-7.4.17RC1, php-8.0.3, php-7.4.16, php-8.0.3RC1, php-7.4.16RC1, php-8.0.2, php-7.4.15, php-7.3.27, php-8.0.2RC1, php-7.4.15RC2, php-7.4.15RC1
# 422d1665 14-Jan-2021 Nikita Popov

Make convert_to_*_ex simple aliases of convert_to_*

Historically, the _ex variants separated the zval first, if a
conversion was necessary. This distinction no longer makes sense
sin

Make convert_to_*_ex simple aliases of convert_to_*

Historically, the _ex variants separated the zval first, if a
conversion was necessary. This distinction no longer makes sense
since PHP 7.

The only difference that was still left is that _ex checked whether
the type is the same first, but the usage of these macros did not
actually distinguish on whether such an inlined check is valuable
or not in a given context.

Also drop the unused convert_to_explicit_type macros.

show more ...

Revision tags: php-8.0.1, php-7.4.14, php-7.3.26, php-7.4.14RC1, php-8.0.1RC1, php-7.3.26RC1, php-8.0.0, php-7.3.25, php-7.4.13, php-8.0.0RC5, php-7.4.13RC1, php-8.0.0RC4, php-7.3.25RC1, php-7.4.12, php-8.0.0RC3, php-7.3.24, php-8.0.0RC2, php-7.4.12RC1, php-7.3.24RC1, php-7.2.34, php-8.0.0rc1, php-7.4.11, php-7.3.23
# 2f601d84 28-Sep-2020 Nikita Popov

Promote warnings in ext/xsl

# 41b096b3 25-Sep-2020 Máté Kocsis

Promote a few forgotten warnings to exceptions

Closes GH-6211

Revision tags: php-8.0.0beta4, php-7.4.11RC1, php-7.3.23RC1
# c98d4769 10-Sep-2020 Máté Kocsis

Consolidate new union type ZPP macro names

They will now follow the canonical order of types. Older macros are
left intact due to maintaining BC.

Closes GH-6112

12345678