summaryrefslogtreecommitdiff
path: root/ext/dom
Commit message (Collapse)AuthorAgeFilesLines
* 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
* | | Add get_gc handle for object iteratorsNikita Popov2020-07-011-1/+2
| | | | | | | | | | | | Optional handler with the same semantics as the object handler.
* | | Update outdated arginfo hashesMáté Kocsis2020-06-301-1/+1
| | |
* | | Don't throw warning if exception thrown during dom validationNikita Popov2020-06-251-1/+3
| | |
* | | Introduce InternalIteratorNikita Popov2020-06-245-5/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Include stub hash in generated arginfo filesNikita Popov2020-06-241-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The hash is used to check whether the arginfo file needs to be regenerated. PHP-Parser will only be downloaded if this is actually necessary. This ensures that release artifacts will never try to regenerate stubs and thus fetch PHP-Parser, as long as you do not modify any files. Closes GH-5739.
* | | Add ZVAL_OBJ_COPY macroNikita Popov2020-06-172-6/+3
| | | | | | | | | | | | | | | For the common ZVAL_OBJ + GC_ADDREF pattern. This mirrors the existing ZVAL_STR_COPY API.
* | | Fix invalid usage of zend_bool in DOM extensionGeorge Peter Banyard2020-06-061-2/+5
| | |
* | | Improve error messages for invalid property accessMáté Kocsis2020-05-182-4/+4
| | | | | | | | | | | | | | | Closes GH-5446 Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
* | | Fix [-Wundef] warning in DOM extensionGeorge Peter Banyard2020-05-1626-47/+47
| | |
* | | Fix UNKNOWN default values in various extensionsMáté Kocsis2020-05-052-6/+5
| | | | | | | | | | | | Closes GH-5514
* | | Merge branch 'PHP-7.4'Nikita Popov2020-04-282-53/+0
|\ \ \ | | | | | | | | | | | | | | | | * PHP-7.4: Revert "Fix #79065: DOM classes do not expose properties to Reflection"
| * | | Revert "Fix #79065: DOM classes do not expose properties to Reflection"Nikita Popov2020-04-282-53/+0
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 6bc8f7e5a9949b2ba79376abd1ed13d0b4d0ae3c. This causes an assertion failure in PHPUnit.
* | | | Merge branch 'PHP-7.4'Christoph M. Becker2020-04-272-0/+53
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.4: Fix #79065: DOM classes do not expose properties to Reflection
| * | | Fix #79065: DOM classes do not expose properties to ReflectionChristoph M. Becker2020-04-272-0/+53
| |/ / | | | | | | | | | | | | We add a `get_properties` handler which complements the already existing `has_property` and `read_property`handlers.
* | | Improve a last couple of argument error messagesMáté Kocsis2020-04-201-1/+1
| | | | | | | | | | | | Closes GH-5404
* | | Generate method entries for ext/domMáté Kocsis2020-04-1359-1536/+1456
| | | | | | | | | | | | Closes GH-5374
* | | Fix nullable types in PHPDocMáté Kocsis2020-04-124-8/+8
| | |
* | | Generate method entries from stubs for a couple of extensionsMáté Kocsis2020-04-114-13/+6
| | | | | | | | | | | | Closes GH-5368
* | | Store default parameter values of internal functions in arg infoMáté Kocsis2020-04-089-39/+39
| | | | | | | | | | | | | | | | | | | | | Closes GH-5353. From now on, PHP will have reflection information about default values of parameters of internal functions. Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
* | | Merge branch 'PHP-7.4'Christoph M. Becker2020-04-081-2/+9
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix memory leak introduced by fixing bug #78221
| * | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-04-081-2/+9
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix memory leak introduced by fixing bug #78221
| | * Fix memory leak introduced by fixing bug #78221Christoph M. Becker2020-04-081-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have to free the retrieved text content; to keep the code readable, we extract a helper function to check for empty nodes. Unfortunately, we cannot use xmlIsBlankNode(), because that also recognizes whitespace only text content. We also make sure to properly handle NULL returns from xmlNodeGetContent().
* | | Merge branch 'PHP-7.4'Christoph M. Becker2020-04-072-0/+25
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #78221: DOMNode::normalize() doesn't remove empty text nodes
| * | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-04-072-0/+25
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix #78221: DOMNode::normalize() doesn't remove empty text nodes