History log of /PHP-8.1/ext/dom/php_dom.c (Results 1 – 25 of 276)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# e127f871 27-Sep-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Restore old namespace reconciliation behaviour

The xmlDOMWrapReconcileNamespaces method we used to fix the namespace
corruption issues in 8.1.21/8.2.8 caused regressions.
Primarily,

Restore old namespace reconciliation behaviour

The xmlDOMWrapReconcileNamespaces method we used to fix the namespace
corruption issues in 8.1.21/8.2.8 caused regressions.
Primarily, there is a similar corruption that the xmlReconciliateNs method
used to have in which a namespace is suddenly shifted
(SAML-Toolkits/php-saml#562) and the side-effect of removing redundant
namespaces causes problems when a specific serialization is required.

Closes GH-12308.

show more ...


# c174ebfc 19-Jun-2023 nielsdos <7771979+nielsdos@users.noreply.github.com>

Revert "Fix GH-11404: DOMDocument::savexml and friends ommit xmlns="" declaration for null namespace, creating incorrect xml representation of the DOM"

This reverts commit 7eb3e9cd173fbdd39e

Revert "Fix GH-11404: DOMDocument::savexml and friends ommit xmlns="" declaration for null namespace, creating incorrect xml representation of the DOM"

This reverts commit 7eb3e9cd173fbdd39eefa791aab610858e76399d.

Although the fix follows the spec, it causes issues because a lot of old
code assumes the incorrect behaviour PHP had since a long time.
We cannot do this yet, especially not in a stable release.
We revert this for the time being.
See GH-11428.

show more ...


# 9f7d8880 17-Jun-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix #80332: Completely broken array access functionality with DOMNamedNodeMap

The problem is the usage of zval_get_long(). In particular, if the
string is non-numeric the result of zval_

Fix #80332: Completely broken array access functionality with DOMNamedNodeMap

The problem is the usage of zval_get_long(). In particular, if the
string is non-numeric the result of zval_get_long() will be 0 without
giving an error or warning. This is misleading for users: users get the
impression that they can use strings to access the map because it
coincidentally works for the first item (which is at index 0). Of
course, this fails with any other index which causes confusion and bugs.

This patch adds proper support for using string offsets while accessing
the map. It does so by detecting if it's a non-numeric string, and then
using the getNamedItem() method instead of item(). I had to split up the
array access implementation code for DOMNodeList and DOMNamedNodeMap
first to be able to do this.

Closes GH-11468.

show more ...


# 7eb3e9cd 16-Jun-2023 nielsdos <7771979+nielsdos@users.noreply.github.com>

Fix GH-11404: DOMDocument::savexml and friends ommit xmlns="" declaration for null namespace, creating incorrect xml representation of the DOM

The NULL namespace is only correct when there i

Fix GH-11404: DOMDocument::savexml and friends ommit xmlns="" declaration for null namespace, creating incorrect xml representation of the DOM

The NULL namespace is only correct when there is no default namespace
override. When there is, we need to manually set it to the empty string
namespace.

Closes GH-11428.

show more ...


# b30be40b 14-Jun-2023 nielsdos <7771979+nielsdos@users.noreply.github.com>

Fix bug #55294 and #47530 and #47847: namespace reconciliation issues

We'll use the DOM wrapper version of libxml2 instead of the regular one.
It's conforming to the behaviour we expect

Fix bug #55294 and #47530 and #47847: namespace reconciliation issues

We'll use the DOM wrapper version of libxml2 instead of the regular one.
It's conforming to the behaviour we expect of DOM.
Most of this patch is tests.

I based and extended the tests on the code attached with the aforementioned
bug reports. Therefore the credits for the tests:
Co-authored-by: hilse at web dot de
Co-authored-by: robin2008 at altruists dot org
Co-authored-by: sgunderson at bigfoot dot com

We'll also change the searching point of the internal reconciliation to
start at the top of the added tree to avoid redundant work now that the
function is changed.

Closes GH-11454.

show more ...


# 10d94aca 11-Jun-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix "invalid state error" with cloned namespace declarations

Closes GH-11429.


# f2d673fb 08-Jun-2023 nielsdos <7771979+nielsdos@users.noreply.github.com>

Fix #70359 and #78577: segfaults with DOMNameSpaceNode

* Fix type confusion and parent reference
* Manually manage the lifetime of the parent
* Add regression tests
* Break out t

Fix #70359 and #78577: segfaults with DOMNameSpaceNode

* Fix type confusion and parent reference
* Manually manage the lifetime of the parent
* Add regression tests
* Break out to a helper, and apply the use-after-free fix to xpath

Closes GH-11402.

show more ...


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

Fix bug #67440: append_node of a DOMDocumentFragment does not reconcile namespaces

The test was amended from the original issue report. For the test:
Co-authored-by: php@deep-freeze.ca

Fix bug #67440: append_node of a DOMDocumentFragment does not reconcile namespaces

The test was amended from the original issue report. For the test:
Co-authored-by: php@deep-freeze.ca

The problem is that the regular dom_reconcile_ns() only works on a
single node. We actually have to reconciliate the whole tree in case a
fragment was added. This also required to move some code around such
that this special case could be handled separately.

Closes GH-11362.

show more ...


# 154c2510 29-May-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix spec compliance error for DOMDocument::getElementsByTagNameNS

Spec link: https://dom.spec.whatwg.org/#concept-getelementsbytagnamens
Spec says we should match any namespace when '*'

Fix spec compliance error for DOMDocument::getElementsByTagNameNS

Spec link: https://dom.spec.whatwg.org/#concept-getelementsbytagnamens
Spec says we should match any namespace when '*' is provided. This was
however not the case: elements that didn't have a namespace were not
returned. This patch fixes the error by modifying the namespace check.

Closes GH-11343.

show more ...


Revision tags: php-8.1.7RC1, php-8.1.4RC1, php-8.1.3, php-8.1.2RC1, php-8.1.0, php-7.3.33, php-7.3.32, php-7.3.31
# 25cbd084 26-Aug-2021 Máté Kocsis

Make a few unuseful DOMEntity properties readonly (#7406)

Revision tags: php-7.3.30, php-7.3.29
# aff36587 29-Jun-2021 Patrick Allaert

Fixed some spaces used instead of tabs

# 0ce23592 09-Jun-2021 Nikita Popov

Remove dom_nnodemap dtor_obj handler

Don't see any obvious reason why this would have to happen in a
dtor_obj handler. If there is a reason, we're lacking test
coverage for it.

# 7da2151f 19-May-2021 Máté Kocsis

Declare typed properties in ext/dom

Closes GH-7013

Revision tags: php-7.3.28, php-7.3.27
# a5e938dc 26-Jan-2021 Máté Kocsis

Declare dynamic properties in ext/dom

Closes GH-6644

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

# d842bc7e 09-Apr-2021 George Peter Banyard

Refactor dom_has_feature() to use zend_string*

# e65f705c 17-Mar-2021 Christoph M. Becker

Merge branch 'PHP-8.0'

* PHP-8.0:
Fix #66783: UAF when appending DOMDocument to element


# fddd0ac5 17-Mar-2021 Christoph M. Becker

Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
Fix #66783: UAF when appending DOMDocument to element


# a08847ab 15-Mar-2021 Christoph M. Becker

Fix #66783: UAF when appending DOMDocument to element

According to the DOM standard, elements may only contain element, text,
processing instruction and comment nodes[1]. It is also spe

Fix #66783: UAF when appending DOMDocument to element

According to the DOM standard, elements may only contain element, text,
processing instruction and comment nodes[1]. It is also specified that
a HierarchyRequestError should be thrown if a document is to be
inserted[2]. We follow that standard, and prevent the use-after-free
this way.

[1] <https://dom.spec.whatwg.org/#node-trees>
[2] <https://dom.spec.whatwg.org/#mutation-algorithms>

Closes GH-6765.

show more ...

# 5f210620 03-Feb-2021 Máté Kocsis

Generate class entries for a few extensions

Relates to GH-6644

# 3e01f5af 15-Jan-2021 Nikita Popov

Replace zend_bool uses with bool

We're starting to see a mix between uses of zend_bool and bool.
Replace all usages with the standard bool type everywhere.

Of course, zend_bool

Replace zend_bool uses with bool

We're starting to see a mix between uses of zend_bool and bool.
Replace all usages with the standard bool type everywhere.

Of course, zend_bool is retained as an alias.

show more ...

Revision tags: php-7.3.26, php-7.3.26RC1, php-7.3.25, php-7.3.25RC1, php-7.3.24, php-7.3.24RC1, php-7.3.23, php-7.3.23RC1, php-7.3.22, php-7.3.22RC1, php-7.3.21, php-7.3.21RC1, php-7.3.20, php-7.3.20RC1, php-7.3.19, php-7.4.7RC1, php-7.3.19RC1, php-7.3.18RC1
# 8fef83dd 19-Apr-2020 George Peter Banyard

Promote warnings to error in DOM extension

Closes GH-5418

# 7991fc27 07-Aug-2020 Nikita Popov

Accept zend_object in zend_read_property

# 2b5de6f8 01-Jul-2020 Max Semenik

Remove proto comments from C files

Closes GH-5758

Revision tags: php-7.2.30, php-7.3.17, php-7.3.17RC1, php-7.3.18, php-7.3.16, php-7.3.16RC1
# ff19ec2d 26-Feb-2020 Nikita Popov

Introduce InternalIterator

Userland classes that implement Traversable must do so either
through Iterator or IteratorAggregate. The same requirement does
not exist for internal class

Introduce InternalIterator

Userland classes that implement Traversable must do so either
through Iterator or IteratorAggregate. The same requirement does
not exist for internal classes: They can implement the internal
get_iterator mechanism, without exposing either the Iterator or
IteratorAggregate APIs. This makes them usable in get_iterator(),
but incompatible with any Iterator based APIs.

A lot of internal classes do this, because exposing the userland
APIs is simply a lot of work. This patch alleviates this issue by
providing a generic InternalIterator class, which acts as an
adapater between get_iterator and Iterator, and can be easily
used by many internal classes. At the same time, we extend the
requirement that Traversable implies Iterator or IteratorAggregate
to internal classes as well.

Closes GH-5216.

show more ...

12345678910>>...12