mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2: Fix GH-14834: Error installing PHP when --with-pear is used
This commit is contained in:
commit
9a337a85bf
3 changed files with 32 additions and 1 deletions
2
NEWS
2
NEWS
|
@ -46,6 +46,8 @@ PHP NEWS
|
||||||
|
|
||||||
- XML:
|
- XML:
|
||||||
. Move away from to-be-deprecated libxml fields. (nielsdos)
|
. Move away from to-be-deprecated libxml fields. (nielsdos)
|
||||||
|
. Fixed bug GH-14834 (Error installing PHP when --with-pear is used).
|
||||||
|
(nielsdos)
|
||||||
|
|
||||||
20 Jun 2024, PHP 8.3.9
|
20 Jun 2024, PHP 8.3.9
|
||||||
|
|
||||||
|
|
|
@ -375,7 +375,7 @@ _get_entity(void *user, const xmlChar *name)
|
||||||
if (ret == NULL)
|
if (ret == NULL)
|
||||||
ret = xmlGetDocEntity(parser->parser->myDoc, name);
|
ret = xmlGetDocEntity(parser->parser->myDoc, name);
|
||||||
|
|
||||||
if (ret == NULL || (parser->parser->instate != XML_PARSER_ENTITY_VALUE && parser->parser->instate != XML_PARSER_ATTRIBUTE_VALUE)) {
|
if (ret == NULL || parser->parser->instate == XML_PARSER_CONTENT) {
|
||||||
if (ret == NULL || ret->etype == XML_INTERNAL_GENERAL_ENTITY || ret->etype == XML_INTERNAL_PARAMETER_ENTITY || ret->etype == XML_INTERNAL_PREDEFINED_ENTITY) {
|
if (ret == NULL || ret->etype == XML_INTERNAL_GENERAL_ENTITY || ret->etype == XML_INTERNAL_PARAMETER_ENTITY || ret->etype == XML_INTERNAL_PREDEFINED_ENTITY) {
|
||||||
/* Predefined entities will expand unless no cdata handler is present */
|
/* Predefined entities will expand unless no cdata handler is present */
|
||||||
if (parser->h_default && ! (ret && ret->etype == XML_INTERNAL_PREDEFINED_ENTITY && parser->h_cdata)) {
|
if (parser->h_default && ! (ret && ret->etype == XML_INTERNAL_PREDEFINED_ENTITY && parser->h_cdata)) {
|
||||||
|
|
29
ext/xml/tests/gh14834.phpt
Normal file
29
ext/xml/tests/gh14834.phpt
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
--TEST--
|
||||||
|
GH-14834 (Error installing PHP when --with-pear is used)
|
||||||
|
--EXTENSIONS--
|
||||||
|
xml
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
$xml = <<<XML
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE root [
|
||||||
|
<!ENTITY foo "ent">
|
||||||
|
]>
|
||||||
|
<root>
|
||||||
|
<element hint="hello'world">&foo;<![CDATA[ & ]]><?x & ?></element>
|
||||||
|
</root>
|
||||||
|
XML;
|
||||||
|
|
||||||
|
$parser = xml_parser_create();
|
||||||
|
xml_set_character_data_handler($parser, function($_, $data) {
|
||||||
|
var_dump($data);
|
||||||
|
});
|
||||||
|
xml_parse($parser, $xml, true);
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
string(3) "
|
||||||
|
"
|
||||||
|
string(3) "ent"
|
||||||
|
string(7) " & "
|
||||||
|
string(1) "
|
||||||
|
"
|
Loading…
Add table
Add a link
Reference in a new issue