summaryrefslogtreecommitdiff
path: root/ext/xml/xml.c
Commit message (Collapse)AuthorAgeFilesLines
* Use zend_string_equals() API instead of strcmp() in various placesGeorge Peter Banyard2021-03-171-1/+1
| | | | Closes GH-6784
* Merge branch 'PHP-8.0'Nikita Popov2021-02-161-0/+1
|\ | | | | | | | | * PHP-8.0: Mark resource-like objects as non-comparable
| * Mark resource-like objects as non-comparableNikita Popov2021-02-161-0/+1
| | | | | | | | | | | | | | As these hold on to some internal resource, there can't be two "equal" objects with different identity. Make sure the lack of public properties doesn't result in these being treated as always equal.
* | Add support for generating class entries from stubsMáté Kocsis2021-01-261-4/+1
| | | | | | | | | | | | Closes GH-6289 Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
* | Replace zend_bool uses with boolNikita Popov2021-01-151-1/+1
| | | | | | | | | | | | | | 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.
* | Make convert_to_*_ex simple aliases of convert_to_*Nikita Popov2021-01-141-1/+1
|/ | | | | | | | | | | | | 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.
* Rename XmlParser to XMLParser for consistency with XMLWriter/XMLReaderGeorge Peter Banyard2020-11-301-2/+2
|
* Fix XmlParser classname in stubsMáté Kocsis2020-10-091-1/+1
|
* Move custom type checks to ZPPMáté Kocsis2020-09-021-1/+2
| | | | Closes GH-6034
* Promote warnings to exceptions in ext/gettext, ext/sysvmsg and ext/xmlMáté Kocsis2020-08-031-11/+8
| | | | Closes GH-5926
* 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.
* Remove no_separation flagNikita Popov2020-07-071-1/+0
|
* Disallow separation in a number of callbacksNikita Popov2020-07-071-2/+1
| | | | All of these clearly do not need separation support.
* Remove proto comments from C filesMax Semenik2020-07-061-44/+22
| | | | Closes GH-5758
* Add flag to forbid dynamic property creation on internal classesNikita Popov2020-06-241-1/+1
| | | | | | | | | | | | | | | | | | | While performing resource -> object migrations, we're adding defensive classes that are final, non-serializable and non-clonable (unless they are, of course). This path adds a ZEND_ACC_NO_DYNAMIC_PROPERTIES flag, that also forbids the creation of dynamic properties on these objects. This is a subset of #3931 and targeted at internal usage only (though may be extended to userland at some point in the future). It's already possible to achieve this (what the removed WeakRef/WeakMap code does), but there's some caveats: First, this simple approach is only possible if the class has no declared properties, otherwise it's necessary to special-case those properties. Second, it's easy to make it overly strict, e.g. by forbidding isset($obj->prop) as well. And finally, it requires a lot of boilerplate code for each class. Closes GH-5572.
* Add ZVAL_OBJ_COPY macroNikita Popov2020-06-171-2/+1
| | | | | For the common ZVAL_OBJ + GC_ADDREF pattern. This mirrors the existing ZVAL_STR_COPY API.
* Fix [-Wundef] warning in XML extensionGeorge Peter Banyard2020-05-201-1/+1
|
* Fix UNKNOWN default values in ext/xmlMáté Kocsis2020-05-061-1/+1
|
* Generate function entries from stubs for a couple of extensionsMáté Kocsis2020-04-141-5/+1
| | | | | Migrates ext/standard, ext/tidy, ext/tokenizer, ext/xml, ext/xml_reader, and ext/xml_writer. Closes GH-5381.
* Generate function entries for another batch of extensionsMáté Kocsis2020-04-051-51/+1
| | | | Closes GH-5352
* Make error messages more consistent by fixing capitalizationMáté Kocsis2020-01-171-1/+1
| | | | Closes GH-5066 As a first step, let's capitalize their initial letter when it is applicable.
* Use RETURN_THROWS() in various placesMáté Kocsis2020-01-031-2/+2
|
* Use RETURN_THROWS() after try_convert_to_string()Máté Kocsis2020-01-031-1/+1
|
* Use RETURN_THROWS() during ZPP in most of the extensionsMáté Kocsis2019-12-311-21/+21
| | | | Except for some bigger ones: reflection, sodium, spl
* Fix bug #78563Mark2019-10-071-2/+6
| | | | | | Make XmlParser final, unclonable and unserializable. Closes GH-4778.
* Remove mention of PHP major version in Copyright headersGabriel Caruso2019-09-251-2/+0
| | | | Closes GH-4732.
* Don't explicitly set return value on ZPP failure in ext/xmlChristoph M. Becker2019-09-031-1/+1
| | | | | Failing ZPP throws as of PHP 8.0.0, so explicitly setting a return value is useless, and also slightly confusing.
* Add ext/xml stubsChristoph M. Becker2019-09-031-108/+2
|
* Merge branch 'PHP-7.4'Nikita Popov2019-06-051-1/+4
|\
| * Allow exceptions in __toString()Nikita Popov2019-06-051-1/+4
| | | | | | | | | | | | | | | | | | | | RFC: https://wiki.php.net/rfc/tostring_exceptions And convert some object to string conversion related recoverable fatal errors into Error exceptions. Improve exception safety of internal code performing string conversions.
* | Merge branch 'PHP-7.4'Dmitry Stogov2019-05-281-1/+2
|\ \ | |/ | | | | | | * PHP-7.4: Replace ZVAL_COPY() and ZVAL_COPY_VALUE() for IS_OBJECT by cheaper macros
| * Replace ZVAL_COPY() and ZVAL_COPY_VALUE() for IS_OBJECT by cheaper macrosDmitry Stogov2019-05-281-1/+2
| |
* | Fix get_gc signatureNikita Popov2019-04-081-3/+3
| |
* | ext/xml: Use object instead of resourceNikita Popov2019-04-081-123/+108
|/ | | | | | | | | | | | Use an XmlParser object instead of a resource. This is an internal representation change, not a conversion to OO APIs. XmlParser objects cannot be explicitly constructed, they are created through the usual xml_parser_* APIs. This change allows us to provide a proper get_gc() implementation, thus resolving bugs #72793 and #76874. xml_parser_free() is a no-op now and need not be called anymore.
* Remove local variablesPeter Kokot2019-02-031-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the so called local variables defined per file basis for certain editors to properly show tab width, and similar settings. These are mainly used by Vim and Emacs editors yet with recent changes the once working definitions don't work anymore in Vim without custom plugins or additional configuration. Neither are these settings synced across the PHP code base. A simpler and better approach is EditorConfig and fixing code using some code style fixing tools in the future instead. This patch also removes the so called modelines for Vim. Modelines allow Vim editor specifically to set some editor configuration such as syntax highlighting, indentation style and tab width to be set in the first line or the last 5 lines per file basis. Since the php test files have syntax highlighting already set in most editors properly and EditorConfig takes care of the indentation settings, this patch removes these as well for the Vim 6.0 and newer versions. With the removal of local variables for certain editors such as Emacs and Vim, the footer is also probably not needed anymore when creating extensions using ext_skel.php script. Additionally, Vim modelines for setting php syntax and some editor settings has been removed from some *.phpt files. All these are mostly not relevant for phpt files neither work properly in the middle of the file.
* Remove yearly range from copyright noticeZeev Suraski2019-01-301-1/+1
|
* Implement typed propertiesNikita Popov2019-01-111-5/+9
| | | | | | | | | | RFC: https://wiki.php.net/rfc/typed_properties_v2 This is a squash of PR #3734, which is a squash of PR #3313. Co-authored-by: Bob Weinand <bobwei9@hotmail.com> Co-authored-by: Joe Watkins <krakjoe@php.net> Co-authored-by: Dmitry Stogov <dmitry@zend.com>
* Merge branch 'PHP-7.3'Christoph M. Becker2018-10-161-0/+6
|\ | | | | | | | | * PHP-7.3: Add support for getting SKIP_TAGSTART and SKIP_WHITE options
| * Merge branch 'PHP-7.2' into PHP-7.3Christoph M. Becker2018-10-161-0/+6
| |\ | | | | | | | | | | | | * PHP-7.2: Add support for getting SKIP_TAGSTART and SKIP_WHITE options
| | * Merge branch 'PHP-7.1' into PHP-7.2Christoph M. Becker2018-10-161-0/+6
| | |\ | | | | | | | | | | | | | | | | * PHP-7.1: Add support for getting SKIP_TAGSTART and SKIP_WHITE options
| | | * Add support for getting SKIP_TAGSTART and SKIP_WHITE optionsChristoph M. Becker2018-10-161-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When `XML_OPTION_SKIP_TAGSTART` and `XML_OPTION_SKIP_WHITE` had been introduced[1], it had been overlooked to also support them for `xml_parser_get_option()`. We catch up on that. [1] <http://git.php.net/?p=php-src.git;a=commit;h=b57dc275950b228f2399990471c4f22b7d154c6c>
| | | * Trim trailing whitespace in source code filesPeter Kokot2018-10-131-45/+45
| | | |
| | * | Trim trailing whitespace in source code filesPeter Kokot2018-10-131-43/+43
| | | |
* | | | Merge branch 'PHP-7.3'Christoph M. Becker2018-10-091-1/+0
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.3: Fix #30875: xml_parse_into_struct() does not resolve entities
| * | | Merge branch 'PHP-7.2' into PHP-7.3Christoph M. Becker2018-10-091-1/+0
| |\ \ \ | | |/ / | | | | | | | | | | | | * PHP-7.2: Fix #30875: xml_parse_into_struct() does not resolve entities
| | * | Merge branch 'PHP-7.1' into PHP-7.2Christoph M. Becker2018-10-091-1/+0
| | |\ \ | | | |/ | | | | | | | | | | | | * PHP-7.1: Fix #30875: xml_parse_into_struct() does not resolve entities
| | | * Fix #30875: xml_parse_into_struct() does not resolve entitiesChristoph M. Becker2018-10-091-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Setting up an empty default handler is not only useless, but actually harmful, since internal entity-references are not resolved anymore. From the libexpat docs[1]: | Setting the handler with this call has the side effect of | turning off expansion of references to internally defined general | entities. Instead these references are passed to the default | handler. [1] <https://www.xml.com/pub/1999/09/expat/reference.html#setdefhandler>
| | | * year++Xinchen Hui2018-01-021-1/+1
| | | |
| | | * Update copyright headers to 2017Sammy Kaye Powers2017-01-041-1/+1
| | | |
| | * | year++Xinchen Hui2018-01-021-1/+1
| | | |