summaryrefslogtreecommitdiff
path: root/ext/dom
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'PHP-8.0'Christoph M. Becker2021-03-172-3/+26
|\ | | | | | | | | * PHP-8.0: Fix #66783: UAF when appending DOMDocument to element
| * Merge branch 'PHP-7.4' into PHP-8.0Christoph M. Becker2021-03-172-3/+26
| |\ | | | | | | | | | | | | * PHP-7.4: Fix #66783: UAF when appending DOMDocument to element
| | * Fix #66783: UAF when appending DOMDocument to elementChristoph M. Becker2021-03-172-3/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Promote DOM invalid state errors during property accessMáté Kocsis2021-03-1619-81/+113
| | | | | | | | | | | | Closes GH-6780
* | | Merge branch 'PHP-8.0'Máté Kocsis2021-03-152-0/+4
|\ \ \ | |/ /
| * | Add missing skipif sections to ext/dom testsMáté Kocsis2021-03-152-0/+4
| | |
* | | Change the order of properties used for var_dump(), serialize(), comparison, ↵Dmitry Stogov2021-03-012-4/+4
| | | | | | | | | | | | | | | | | | etc. Now properties are ordered according to their layout in zend_object structure.
* | | Merge branch 'PHP-8.0'Nikita Popov2021-02-242-2/+2
|\ \ \ | |/ / | | | | | | | | | | | | | | | * PHP-8.0: Fix potential file collision in dom tests Fix bug #80757 (Exit code is 0 when could not open file) Update NEWS
| * | Merge branch 'PHP-7.4' into PHP-8.0Nikita Popov2021-02-242-2/+2
| |\ \ | | |/ | | | | | | | | | * PHP-7.4: Fix potential file collision in dom tests
| | * Fix potential file collision in dom testsNikita Popov2021-02-242-2/+2
| | |
| * | Add missing classes to stubsMáté Kocsis2021-02-092-12/+21
| | |
* | | Generate class entries from stubs for com, standard, xmlreader, xmlwriter, ↵Máté Kocsis2021-02-221-5/+0
| | | | | | | | | | | | | | | | | | xsl, zip, Zend Closes GH-6706
* | | Improve class entry generationMáté Kocsis2021-02-161-23/+22
| | | | | | | | | | | | Related to GH-6701
* | | Deprecate passing null to non-nullable arg of internal functionNikita Popov2021-02-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This deprecates passing null to non-nullable scale arguments of internal functions, with the eventual goal of making the behavior consistent with userland functions, where null is never accepted for non-nullable arguments. This change is expected to cause quite a lot of fallout. In most cases, calling code should be adjusted to avoid passing null. In some cases, PHP should be adjusted to make some function arguments nullable. I have already fixed a number of functions before landing this, but feel free to file a bug if you encounter a function that doesn't accept null, but probably should. (The rule of thumb for this to be applicable is that the function must have special behavior for 0 or "", which is distinct from the natural behavior of the parameter.) RFC: https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_arg Closes GH-6475.
* | | Implicitly enable function entry generation when class entry generation is ↵Máté Kocsis2021-02-092-5/+2
| | | | | | | | | | | | | | | | | | enabled Closes GH-6675
* | | Merge branch 'PHP-8.0'Nikita Popov2021-02-094-4/+5
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Make createDocument() $namespace nullable
| * | Make createDocument() $namespace nullableNikita Popov2021-02-094-4/+5
| | | | | | | | | | | | | | | | | | According to the DOM specification, this argument should be nullable. It's also supposed to be a required argument, but not changing that at this point.
* | | Merge branch 'PHP-8.0'Nikita Popov2021-02-095-12/+20
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Make getElementsByTagNameNS $namespace nullable
| * | Make getElementsByTagNameNS $namespace nullableNikita Popov2021-02-095-12/+20
| | | | | | | | | | | | | | | According to the DOM specification, this argument is supposed to be nullable.
* | | Generate class entries for a few extensionsMáté Kocsis2021-02-033-74/+318
| | | | | | | | | | | | Relates to GH-6644
* | | [ci-skip] Merge branch 'PHP-8.0'Benjamin Eberlei2021-02-023-38/+17
|\ \ \ | |/ /
| * | Fix bug #80600 DOMChildNode::remove does not work on DOMCharacterData.Benjamin Eberlei2021-02-023-38/+17
| | | | | | | | | | | | Closes GH-6660
* | | Add support for generating class entries from stubsMáté Kocsis2021-01-262-1/+3
| | | | | | | | | | | | | | | | | | Closes GH-6289 Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
* | | Replace zend_bool uses with boolNikita Popov2021-01-157-14/+14
|/ / | | | | | | | | | | | | 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.
* | Add support for generating methodsynopses from stubsMáté Kocsis2020-12-282-2/+2
| | | | | | | | Closes GH-6367
* | Fix bug #80537Nikita Popov2020-12-212-7/+7
| | | | | | | | | | | | | | | | This is an unavoidable breaking change to both the type and parameter name. The assertion that was supposed to prevent this was overly lax and accepted any object type for string parameters.
* | Merge branch 'PHP-7.4' into PHP-8.0Christoph M. Becker2020-10-262-1/+24
|\ \ | |/ | | | | | | * PHP-7.4: Fix #80268: loadHTML() truncates at NUL bytes
| * Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-10-262-1/+24
| |\ | | | | | | | | | | | | * PHP-7.3: Fix #80268: loadHTML() truncates at NUL bytes
| | * Fix #80268: loadHTML() truncates at NUL bytesChristoph M. Becker2020-10-262-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | libxml2 has no particular issues parsing HTML strings with NUL bytes; these just cause truncation of the current text content, but parsing continues generally. Since `::loadHTMLFile()` already supports NUL bytes, `::loadHTML()` should as well. Note that this is different from XML, which does not allow any NUL bytes. Closes GH-6368.
* | | Make handling of NULL bytes in file paths more consistent (WIP)Dik Takken2020-09-299-44/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not all extensions consistently throw exceptions when the user passes a path name containing null bytes. Also, some extensions would throw a ValueError while others would throw a TypeError. Error messages also varied. Now a ValueError is thrown after all failed path checks, at least for as far as these occur in functions that are exposed to userland. Closes GH-6216.
* | | Fix a few ZEND_UNREACHABLE() callsMáté Kocsis2020-09-231-1/+2
| | |
* | | Promote warnings to error in DOM extensionGeorge Peter Banyard2020-09-2225-143/+208
| | | | | | | | | | | | Closes GH-5418
* | | Run tidyNikita Popov2020-09-181-2/+2
| | | | | | | | | | | | | | | This should fix most of the remaining issues with tabs and spaces being mixed in tests.
* | | Display types in stubs more uniformlyMáté Kocsis2020-09-162-4/+3
| | | | | | | | | | | | | | | | | | In preparation for generating method signatures for the manual. This change gets rid of bogus false|null return types, a few unnecessary trailing backslashes, and settles on using ? when possible for nullable types.
* | | Consolidate new union type ZPP macro namesMáté Kocsis2020-09-111-1/+1
| | | | | | | | | | | | | | | | | | | | | They will now follow the canonical order of types. Older macros are left intact due to maintaining BC. Closes GH-6112
* | | Improve error messages mentioning parameters instead of argumentsMáté Kocsis2020-09-094-4/+4
| | | | | | | | | | | | Closes GH-5999
* | | Fix #79968: Manipulation on unattached DOMChildNode should throw DOMExceptionBenjamin Eberlei2020-08-192-0/+22
| | |
* | | Add all the missing parameter types to stubsMáté Kocsis2020-08-132-18/+18
| | | | | | | | | | | | Closes GH-5955
* | | Throw Error exception in DOM_GET_OBJNikita Popov2020-08-131-2/+2
| | | | | | | | | | | | Per general convention for handling of uninitialized objects.
* | | Add many missing closing PHP tags to testsMáté Kocsis2020-08-0918-0/+18
| | | | | | | | | | | | Closes GH-5958
* | | Accept zend_object in zend_read_propertyNikita Popov2020-08-071-5/+2
| | |
* | | Implement named parametersNikita Popov2020-07-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From an engine perspective, named parameters mainly add three concepts: * The SEND_* opcodes now accept a CONST op2, which is the argument name. For now, it is looked up by linear scan and runtime cached. * This may leave UNDEF arguments on the stack. To avoid having to deal with them in other places, a CHECK_UNDEF_ARGS opcode is used to either replace them with defaults, or error. * For variadic functions, EX(extra_named_params) are collected and need to be freed based on ZEND_CALL_HAS_EXTRA_NAMED_PARAMS. RFC: https://wiki.php.net/rfc/named_params Closes GH-5357.
* | | Consolidate Parameter Names For ext/domBenjamin Eberlei2020-07-272-99/+97
| | | | | | | | | | | | Co-authored-by: Thomas Weinert <thomas@weinert.info>
* | | Remove spurious return true from DOMXPath::registerPhpFunctions()Nikita Popov2020-07-173-3/+2
| | | | | | | | | | | | | | | Only one of three identical cases returned true, and the function is documented to return void. Remove the outlier.
* | | Use string|array type in DOMXPath::registerPhpFunctions()Nikita Popov2020-07-173-20/+18
| | |
* | | Fixed bug #79852Nikita Popov2020-07-141-0/+36
| | |
* | | Review the usage of apostrophes in error messagesMáté Kocsis2020-07-103-5/+5
| | | | | | | | | | | | Closes GH-5590
* | | Remove no_separation flagNikita Popov2020-07-071-1/+0
| | |
* | | Disallow separation in a number of callbacksNikita Popov2020-07-071-1/+1
| | | | | | | | | | | | All of these clearly do not need separation support.
* | | Remove proto comments from C filesMax Semenik2020-07-0616-203/+108
| | | | | | | | | | | | Closes GH-5758