-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ead3b8e
commit 4cba523
Showing
5 changed files
with
134 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
php8.3 |
64 changes: 64 additions & 0 deletions
64
contrib/php8.3/patches/67259e451d5d58b4842776c5696a66d74e157609.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
From 67259e451d5d58b4842776c5696a66d74e157609 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. | ||
|
||
Closes GH-14837. | ||
--- | ||
ext/xml/compat.c | 2 +- | ||
ext/xml/tests/gh14834.phpt | 29 +++++++++++++++++++++++++++++ | ||
3 files changed, 32 insertions(+), 1 deletion(-) | ||
create mode 100644 ext/xml/tests/gh14834.phpt | ||
|
||
diff --git a/ext/xml/compat.c b/ext/xml/compat.c | ||
index 242cc4ba7c40c..5f55dc62b3687 100644 | ||
--- a/ext/xml/compat.c | ||
+++ b/ext/xml/compat.c | ||
@@ -375,7 +375,7 @@ _get_entity(void *user, const xmlChar *name) | ||
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)) { | ||
diff --git a/ext/xml/tests/gh14834.phpt b/ext/xml/tests/gh14834.phpt | ||
new file mode 100644 | ||
index 0000000000000..2781ba2ed0941 | ||
--- /dev/null | ||
+++ b/ext/xml/tests/gh14834.phpt | ||
@@ -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) " | ||
+" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
commit ef3e6b44 | ||
Author: Renato Botelho do Couto <renato@netgate.com> | ||
Date: Mon Jul 8 16:15:05 2024 | ||
|
||
pear: Fix PHP shebang line | ||
|
||
diff --git a/pear/Makefile.frag b/pear/Makefile.frag | ||
index 9408757a..96d79f61 100644 | ||
--- a/pear/Makefile.frag | ||
+++ b/pear/Makefile.frag | ||
@@ -10,7 +10,7 @@ PEAR_SUFFIX = -ds a$(program_suffix) | ||
PEAR_INSTALLER_URL = https://pear.php.net/install-pear-nozlib.phar | ||
|
||
install-pear-installer: $(SAPI_CLI_PATH) | ||
- @$(top_builddir)/sapi/cli/php $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX} | ||
+ @$(top_builddir)/sapi/cli/php $(PEAR_INSTALL_FLAGS) pear/install-pear-nozlib.phar -p "$(bindir)/$(program_prefix)php$(program_suffix)" -d "$(peardir)" -b "$(bindir)" ${PEAR_PREFIX} ${PEAR_SUFFIX} | ||
|
||
install-pear: | ||
@echo "Installing PEAR environment: $(INSTALL_ROOT)$(peardir)/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- ./pear/Makefile.frag.orig 2013-04-12 07:02:27.041602514 +0000 | ||
+++ ./pear/Makefile.frag 2013-04-12 07:04:09.065836822 +0000 | ||
@@ -1,7 +1,10 @@ | ||
peardir=$(PEAR_INSTALLDIR) | ||
|
||
+# help the built php to find xml extension so we can install pear | ||
+PEAR_INSTALL_XML_FLAGS = -d extension="$(top_builddir)/modules/xml.so" -d extension="$(top_builddir)/modules/phar.so" | ||
+ | ||
# Skip all php.ini files altogether | ||
-PEAR_INSTALL_FLAGS = -n -dshort_open_tag=0 -dopen_basedir= -derror_reporting=1803 -dmemory_limit=-1 -ddetect_unicode=0 | ||
+PEAR_INSTALL_FLAGS = -n -dshort_open_tag=0 -dopen_basedir= -derror_reporting=1803 -dmemory_limit=-1 -ddetect_unicode=0 $(PEAR_INSTALL_XML_FLAGS) | ||
|
||
WGET = `which wget 2>/dev/null` | ||
FETCH = `which fetch 2>/dev/null` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters