summaryrefslogtreecommitdiff
path: root/ext/simplexml/simplexml.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix UNKNOWN default values in various extensionsMáté Kocsis2020-09-071-1/+1
| | | | Closes GH-6075
* Promote warnings to exceptions in ext/simplexmlMáté Kocsis2020-08-251-19/+19
| | | | | | Closes GH-6011 Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
* Don't return temporary from SXE write_property handlerNikita Popov2020-08-251-24/+17
| | | | | | | | Return the original value. If we don't return the original value, we need to own the zval, which we don't. For clarity also switch things to work on a zend_string* value instead of a zval*.
* Simplify change_node_zval implementationNikita Popov2020-08-251-25/+6
| | | | At this point, the value has already been converted into a string.
* Add a missing null check in simplexmlNikita Popov2020-08-131-0/+5
|
* Throw on uninitialized SimpleXMLElementNikita Popov2020-08-131-22/+20
| | | | | Elevate this warning into an Error, as usual. Add a few checks in places that were missing them.
* Remove proto comments from C filesMax Semenik2020-07-061-98/+49
| | | | 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.
* Make SimpleXMLElement a RecursiveIteratorNikita Popov2020-06-241-8/+147
| | | | | | | | | | | | | | | | | | Context: https://externals.io/message/108789 This essentially moves the functionality of SimpleXMLIterator into SimpleXMLElement, and makes SimpleXMLIterator a no-op extension. Ideally SimpleXMLElement would be an IteratorAggregate, whose getIterator() method returns SimpleXMLIterator. However, because SimpleXMLIterator extends SimpleXMLElement (and code depends on this in non-trivial ways), this is not possible. The only way to not keep SimpleXMLElement as a magic Traversable (that implements neither Iterator nor IteratorAggregate) is to move the SimpleXMLIterator functionality into it. Closes GH-5234.
* Fix #63575: Root elements are not properly clonedChristoph M. Becker2020-06-171-5/+17
| | | | | Cloning of root elements has to preserve that property, so they require some special treatment.
* Add ZVAL_OBJ_COPY macroNikita Popov2020-06-171-5/+4
| | | | | For the common ZVAL_OBJ + GC_ADDREF pattern. This mirrors the existing ZVAL_STR_COPY API.
* Fix warning of strict-prototypestwosee2020-06-071-1/+1
| | | | Closes GH-5673.
* Fix [-Wundef] warning in SimpleXML extensionGeorge Peter Banyard2020-05-201-1/+1
|
* Merge branch 'PHP-7.4'Christoph M. Becker2020-05-011-1/+1
|\ | | | | | | | | * PHP-7.4: Fix #79528: Different object of the same xml between 7.4.5 and 7.4.4
| * Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-05-011-1/+1
| |\ | | | | | | | | | | | | * PHP-7.3: Fix #79528: Different object of the same xml between 7.4.5 and 7.4.4
| | * Fix #79528: Different object of the same xml between 7.4.5 and 7.4.4Christoph M. Becker2020-05-011-1/+1
| | | | | | | | | | | | | | | | | | Revert "Fix #61597: SXE properties may lack attributes and content" This reverts commit 7c081db885756d7b176a55b90b8746f664d1e042.
* | | Generate function entries from stubsMáté Kocsis2020-04-201-32/+3
| | | | | | | | | | | | | | | Converts ext/pcntl, ext/simplexml, ext/snmp, ext/soap, ext/sqlite3. Closes GH-5421
* | | Clarify SimpleXML comparison logicNikita Popov2020-03-311-7/+15
| | |
* | | Add a ZEND_UNCOMPARABLE valueNikita Popov2020-03-311-1/+1
| | | | | | | | | | | | | | | | | | To explicitly indicate that objects are uncomparable. For now this has no functional difference from the usual 1 return value, but makes intent clearer.
* | | Improve error messages of various extensionsMáté Kocsis2020-03-231-3/+3
| | | | | | | | | | | | Closes GH-5278
* | | Merge branch 'PHP-7.4'Christoph M. Becker2020-03-121-1/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #61597: SXE properties may lack attributes and content
| * | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-03-121-1/+1
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix #61597: SXE properties may lack attributes and content
| | * Fix #61597: SXE properties may lack attributes and contentChristoph M. Becker2020-03-121-1/+1
| | | | | | | | | | | | | | | We must not treat a node as string if it has attributes, unless it is an entity declaration which is always treated as string by simplexml.
* | | Define Stringable with __toString():string methodNicolas Grekas2020-03-021-1/+1
| | |
* | | Use RETURN_THROWS() after zend_throw_exception() in most of the extensionsMáté Kocsis2020-01-021-4/+4
| | |
* | | Use RETURN_THROWS() during ZPP in most of the extensionsMáté Kocsis2019-12-311-16/+16
| | | | | | | | | | | | Except for some bigger ones: reflection, sodium, spl
* | | zend_parse_parameters_throw() is obsoleteChristoph M. Becker2019-11-011-1/+1
| | | | | | | | | | | | | | | | | | Since `zend_parse_parameters()` throws now, there is no reason to explicitly call `zend_parse_parameters_throw()` anymore, and since both have actually the same implementation, we redefine the latter as macro.
* | | Comparison cleanup:Dmitry Stogov2019-10-071-1/+3
| | | | | | | | | | | | | | | - introduce zend_compare() that returns -1,0,1 dirctly (without intermediate zval) - remove compare_objects() object handler, and keep only compare() handler
* | | Merge branch 'PHP-7.4'Joe Watkins2019-10-021-1/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fixed #75245 Don't set content of elements with only whitespaces
| * | Fixed #75245 Don't set content of elements with only whitespacesErik Lundin2019-10-021-1/+1
| | |
* | | Remove mention of PHP major version in Copyright headersGabriel Caruso2019-09-251-2/+0
| | | | | | | | | | | | Closes GH-4732.
* | | Just return on throwing ZPPChristoph M. Becker2019-09-251-1/+1
| | |
* | | Add missing zend_parse_parameters_none()Christoph M. Becker2019-09-251-0/+8
| | |
* | | Add SimpleXML arginfo stubsStephen Reay2019-09-251-81/+15
| | |
* | | Normalize SimpleXML::asXML() argument handlingNikita Popov2019-08-151-60/+48
| | | | | | | | | | | | Remove odd manual checks in favor of a standard zpp call.
* | | Add do...while(0) for RETURN_* and ZVAL_* APIstwosee2019-06-121-1/+1
| | | | | | | | | | | | Closes GH-4255.
* | | Merge branch 'PHP-7.4'Dmitry Stogov2019-06-061-11/+14
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Cheaper checks for exceptions thrown from __toString()
| * | Cheaper checks for exceptions thrown from __toString()Dmitry Stogov2019-06-061-11/+14
| | |
* | | Merge branch 'PHP-7.4'Nikita Popov2019-06-051-1/+13
|\ \ \ | |/ /
| * | Allow exceptions in __toString()Nikita Popov2019-06-051-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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'Christoph M. Becker2019-05-311-1/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: SimpleXMLElement and ResourceBundle implement Countable
| * | SimpleXMLElement and ResourceBundle implement CountableThomas Gerbet2019-05-311-1/+1
| | | | | | | | | | | | | | | Both classes already have a count() method and are considered countable by \is_countable().
* | | Remove get() object handlerNikita Popov2019-05-291-14/+7
| | | | | | | | | | | | | | | | | | | | | | | | Now that set() is gone, there is little point in keeping get(), as it is essentially just a different way of writing cast_object() now. Closes GH-4202.
* | | Merge branch 'PHP-7.4'Dmitry Stogov2019-05-281-2/+3
|\ \ \ | |/ / | | | | | | | | | * 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-2/+3
| | |
* | | Merge branch 'PHP-7.4'Nikita Popov2019-05-141-1/+1
|\ \ \ | |/ /
| * | Add RETURN_EMPTY_ARRAY() / RETVAL_EMPTY_ARRAY()Nikita Popov2019-05-141-1/+1
| | | | | | | | | | | | The usual wrappers around ZVAL_EMPTY_ARRAY()...
* | | Merge branch 'PHP-7.4'Nikita Popov2019-04-151-2/+4
|\ \ \ | |/ /
| * | Fix last maybe uninit warnings on 7.4Nikita Popov2019-04-151-2/+4
| | | | | | | | | | | | | | | Most of these only occur under GCC 5. Not fond of all the workarounds (especially the PDO one), but it gets us a clean build...
* | | Refactor zend_object_handlers API to pass zend_object* and zend_string* ↵Dmitry Stogov2019-02-041-46/+54
|/ / | | | | | | insted of zval(s).