Projects
home:rottame:vhosts-ng:php80
php8
php8-xml-libxml213.patch
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File php8-xml-libxml213.patch of Package php8
From dc2ce0df9be530e7ee91b0dfa6eb6ce2d5e5baad Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Fri, 5 Jul 2024 23:34:09 +0200 Subject: [PATCH] Fix GH-14834: Error installing PHP when --with-pear is used libxml2 2.13 makes changes to how the parsing state is set, update our code accordingly. In particular, it started reporting entities within attributes, while it should only report entities inside text nodes. [vhng: backported to PHP 8.0.30, test uses SKIPIF instead of --EXTENSIONS--] --- --- a/ext/xml/compat.c +++ b/ext/xml/compat.c @@ -375,7 +375,7 @@ if (ret == NULL) 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) { /* Predefined entities will expand unless no cdata handler is present */ if (parser->h_default && ! (ret && ret->etype == XML_INTERNAL_PREDEFINED_ENTITY && parser->h_cdata)) { --- /dev/null +++ b/ext/xml/tests/gh14834.phpt @@ -0,0 +1,29 @@ +--TEST-- +GH-14834 (Error installing PHP when --with-pear is used) +--SKIPIF-- +<?php require_once("skipif.inc"); ?> +--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) " +"
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.