commit 1286b1831c3a84d236b290af0bcc38af06009094
Author: Arkadiusz Miśkiewicz <[email protected]>
Date:   Tue Aug 6 09:30:46 2024 +0200

    Up to 8.1.29

 libxml.patch           | 205 +++++++++++++++++++++++++++++++++++++++++++++++++
 missing-includes.patch |  22 ------
 php.spec               |  12 ++-
 3 files changed, 210 insertions(+), 29 deletions(-)
---
diff --git a/php.spec b/php.spec
index 49ab89a..40b4cbe 100644
--- a/php.spec
+++ b/php.spec
@@ -148,8 +148,8 @@ Summary(pt_BR.UTF-8):       A linguagem de script PHP
 Summary(ru.UTF-8):     PHP - язык препроцессирования HTML-файлов, выполняемый 
на сервере
 Summary(uk.UTF-8):     PHP - мова препроцесування HTML-файлів, виконувана на 
сервері
 Name:          %{orgname}%{php_suffix}
-Version:       8.1.19
-Release:       7
+Version:       8.1.29
+Release:       1
 Epoch:         4
 # All files licensed under PHP version 3.01, except
 # Zend is licensed under Zend
@@ -157,7 +157,7 @@ Epoch:              4
 License:       PHP 3.01 and Zend and BSD
 Group:         Libraries
 Source0:       https://www.php.net/distributions/%{orgname}-%{version}.tar.xz
-# Source0-md5: 7a06e016b0af0af215a0d3a18f06e29d
+# Source0-md5: eee68a22dde7e8024e1d528131a2c922
 Source1:       opcache.ini
 Source2:       %{orgname}-mod_php.conf
 Source3:       %{orgname}-cgi-fcgi.ini
@@ -180,7 +180,7 @@ Patch5:             openssl.patch
 Patch6:                opcache-nokill-perm.patch
 Patch7:                %{orgname}-sapi-ini-file.patch
 Patch8:                curl.patch
-
+Patch9:                libxml.patch
 Patch10:       %{orgname}-ini.patch
 Patch11:       embed.patch
 Patch14:       %{orgname}-no_pear_install.patch
@@ -206,7 +206,6 @@ Patch67:    mysql-lib-ver-mismatch.patch
 # https://bugs.php.net/bug.php?id=68344
 Patch68:       php-mysql-ssl-context.patch
 Patch71:       libdb-info.patch
-Patch72:       missing-includes.patch
 URL:           https://www.php.net/
 %{?with_pdo_firebird:%{!?with_interbase_inst:BuildRequires:    Firebird-devel 
>= 1.0.2.908-2}}
 %{?with_pspell:BuildRequires:  aspell-devel >= 2:0.50.0}
@@ -1880,7 +1879,7 @@ cp -p php.ini-production php.ini
 %patch6 -p1
 %patch7 -p1 -b .sapi-ini-file
 %patch8 -p1
-
+%patch9 -p1
 %patch10 -p1 -b .ini
 %patch14 -p1
 %patch18 -p1
@@ -1906,7 +1905,6 @@ cp -p php.ini-production php.ini
 %patch67 -p1 -b .mysql-lib-ver-mismatch
 #%patch68 -p1 DROP or update to 7.0 APIs
 %patch71 -p1 -b .libdb-info
-%patch72 -p1
 
 sed -E -i -e '1s,#!\s*/usr/bin/env\s+(.*),#!%{__bindir}\1,' \
       ext/ext_skel.php \
diff --git a/libxml.patch b/libxml.patch
new file mode 100644
index 0000000..53607db
--- /dev/null
+++ b/libxml.patch
@@ -0,0 +1,205 @@
+commit 0a39890c967aa57225bb6bdf4821aff7a3a3c082
+Author: Niels Dossche <[email protected]>
+Date:   Fri Dec 1 18:03:35 2023 +0100
+
+    Fix libxml2 2.12 build due to API breaks
+    
+    See https://github.com/php/php-src/actions/runs/7062192818/job/19225478601
+
+diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c
+index 22eb1901b8..1de693892b 100644
+--- a/ext/libxml/libxml.c
++++ b/ext/libxml/libxml.c
+@@ -472,7 +472,11 @@ static void _php_libxml_free_error(void *ptr)
+       xmlResetError((xmlErrorPtr) ptr);
+ }
+ 
+-static void _php_list_set_error_structure(xmlErrorPtr error, const char *msg)
++#if LIBXML_VERSION >= 21200
++static void _php_list_set_error_structure(const xmlError *error, const char 
*msg)
++#else
++static void _php_list_set_error_structure(xmlError *error, const char *msg)
++#endif
+ {
+       xmlError error_copy;
+       int ret;
+@@ -725,7 +729,11 @@ PHP_LIBXML_API void php_libxml_ctx_warning(void *ctx, 
const char *msg, ...)
+       va_end(args);
+ }
+ 
++#if LIBXML_VERSION >= 21200
++PHP_LIBXML_API void php_libxml_structured_error_handler(void *userData, const 
xmlError *error)
++#else
+ PHP_LIBXML_API void php_libxml_structured_error_handler(void *userData, 
xmlErrorPtr error)
++#endif
+ {
+       _php_list_set_error_structure(error, NULL);
+ 
+@@ -957,11 +965,9 @@ PHP_FUNCTION(libxml_use_internal_errors)
+ /* {{{ Retrieve last error from libxml */
+ PHP_FUNCTION(libxml_get_last_error)
+ {
+-      xmlErrorPtr error;
+-
+       ZEND_PARSE_PARAMETERS_NONE();
+ 
+-      error = xmlGetLastError();
++      const xmlError *error = xmlGetLastError();
+ 
+       if (error) {
+               object_init_ex(return_value, libxmlerror_class_entry);
+diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c
+index 749f5a5685..b731114775 100644
+--- a/ext/soap/php_sdl.c
++++ b/ext/soap/php_sdl.c
+@@ -332,7 +332,7 @@ static void load_wsdl_ex(zval *this_ptr, char *struri, 
sdlCtx *ctx, int include)
+       sdl_restore_uri_credentials(ctx);
+ 
+       if (!wsdl) {
+-              xmlErrorPtr xmlErrorPtr = xmlGetLastError();
++              const xmlError *xmlErrorPtr = xmlGetLastError();
+ 
+               if (xmlErrorPtr) {
+                       soap_error2(E_ERROR, "Parsing WSDL: Couldn't load from 
'%s' : %s", struri, xmlErrorPtr->message);
+commit 4fe821311cafb18ca8bdf20b9d796c48a13ba552
+Author: Niels Dossche <[email protected]>
+Date:   Thu Jul 4 06:29:50 2024 -0700
+
+    Backport libxml2 2.13.2 fixes (#14816)
+    
+    Backproted from https://github.com/php/php-src/pull/14789
+
+diff --git a/ext/dom/document.c b/ext/dom/document.c
+index 38af4ca27c..516ffffae8 100644
+--- a/ext/dom/document.c
++++ b/ext/dom/document.c
+@@ -1292,11 +1292,13 @@ static xmlDocPtr dom_document_parser(zval *id, int 
mode, char *source, size_t so
+       if (keep_blanks == 0 && ! (options & XML_PARSE_NOBLANKS)) {
+               options |= XML_PARSE_NOBLANKS;
+       }
++      if (recover) {
++              options |= XML_PARSE_RECOVER;
++      }
+ 
+       php_libxml_sanitize_parse_ctxt_options(ctxt);
+       xmlCtxtUseOptions(ctxt, options);
+ 
+-      ctxt->recovery = recover;
+       if (recover) {
+               old_error_reporting = EG(error_reporting);
+               EG(error_reporting) = old_error_reporting | E_WARNING;
+@@ -1306,7 +1308,7 @@ static xmlDocPtr dom_document_parser(zval *id, int mode, 
char *source, size_t so
+ 
+       if (ctxt->wellFormed || recover) {
+               ret = ctxt->myDoc;
+-              if (ctxt->recovery) {
++              if (recover) {
+                       EG(error_reporting) = old_error_reporting;
+               }
+               /* If loading from memory, set the base reference uri for the 
document */
+diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c
+index 1de693892b..5f9749ffed 100644
+--- a/ext/libxml/libxml.c
++++ b/ext/libxml/libxml.c
+@@ -419,8 +419,10 @@ php_libxml_input_buffer_create_filename(const char *URI, 
xmlCharEncoding enc)
+ static xmlOutputBufferPtr
+ php_libxml_output_buffer_create_filename(const char *URI,
+                               xmlCharEncodingHandlerPtr encoder,
+-                              int compression ATTRIBUTE_UNUSED)
++                              int compression)
+ {
++      ZEND_IGNORE_VALUE(compression);
++
+       xmlOutputBufferPtr ret;
+       xmlURIPtr puri;
+       void *context = NULL;
+diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c
+index c52677b6c6..82b21d1588 100644
+--- a/ext/soap/php_encoding.c
++++ b/ext/soap/php_encoding.c
+@@ -3374,7 +3374,6 @@ xmlNsPtr encode_add_ns(xmlNodePtr node, const char* ns)
+               } else {
+                       smart_str prefix = {0};
+                       int num = ++SOAP_GLOBAL(cur_uniq_ns);
+-                      xmlChar *enc_ns;
+ 
+                       while (1) {
+                               smart_str_appendl(&prefix, "ns", 2);
+@@ -3388,9 +3387,15 @@ xmlNsPtr encode_add_ns(xmlNodePtr node, const char* ns)
+                               num = ++SOAP_GLOBAL(cur_uniq_ns);
+                       }
+ 
+-                      enc_ns = xmlEncodeSpecialChars(node->doc, BAD_CAST(ns));
++                      /* Starting with libxml 2.13, we don't have to do this 
workaround anymore, otherwise we get double-encoded
++                       * entities. See libxml2 commit 
f506ec66547ef9bac97a2bf306d368ecea8c0c9e. */
++#if LIBXML_VERSION < 21300
++                      xmlChar *enc_ns = xmlEncodeSpecialChars(node->doc, 
BAD_CAST(ns));
+                       xmlns = xmlNewNs(node->doc->children, enc_ns, 
BAD_CAST(prefix.s ? ZSTR_VAL(prefix.s) : ""));
+                       xmlFree(enc_ns);
++#else
++                      xmlns = xmlNewNs(node->doc->children, BAD_CAST(ns), 
BAD_CAST(prefix.s ? ZSTR_VAL(prefix.s) : ""));
++#endif
+                       smart_str_free(&prefix);
+               }
+       }
+diff --git a/ext/soap/php_xml.c b/ext/soap/php_xml.c
+index 3ff7aa055f..20fd91ac4b 100644
+--- a/ext/soap/php_xml.c
++++ b/ext/soap/php_xml.c
+@@ -92,13 +92,16 @@ xmlDocPtr soap_xmlParseFile(const char *filename)
+               bool old;
+ 
+               php_libxml_sanitize_parse_ctxt_options(ctxt);
++              /* TODO: In libxml2 2.14.0 change this to the new options API 
so we don't rely on deprecated APIs. */
++              
+               ctxt->keepBlanks = 0;
++              ctxt->options |= XML_PARSE_HUGE;
++              
+               ctxt->sax->ignorableWhitespace = soap_ignorableWhitespace;
+               ctxt->sax->comment = soap_Comment;
+               ctxt->sax->warning = NULL;
+               ctxt->sax->error = NULL;
+               /*ctxt->sax->fatalError = NULL;*/
+-              ctxt->options |= XML_PARSE_HUGE;
+               old = php_libxml_disable_entity_loader(1);
+               xmlParseDocument(ctxt);
+               php_libxml_disable_entity_loader(old);
+@@ -146,7 +149,10 @@ xmlDocPtr soap_xmlParseMemory(const void *buf, size_t 
buf_size)
+               ctxt->sax->warning = NULL;
+               ctxt->sax->error = NULL;
+               /*ctxt->sax->fatalError = NULL;*/
++              /* TODO: In libxml2 2.14.0 change this to the new options API 
so we don't rely on deprecated APIs. */
++              
+               ctxt->options |= XML_PARSE_HUGE;
++              
+               old = php_libxml_disable_entity_loader(1);
+               xmlParseDocument(ctxt);
+               php_libxml_disable_entity_loader(old);
+diff --git a/ext/xml/compat.c b/ext/xml/compat.c
+index 5c41e7d2f5..7b463ebb51 100644
+--- a/ext/xml/compat.c
++++ b/ext/xml/compat.c
+@@ -714,8 +714,7 @@ XML_GetCurrentByteCount(XML_Parser parser)
+ {
+       /* WARNING: this is identical to ByteIndex; it should probably
+        * be different */
+-      return parser->parser->input->consumed +
+-                      (parser->parser->input->cur - 
parser->parser->input->base);
++      return XML_GetCurrentByteIndex(parser);
+ }
+ 
+ PHP_XML_API const XML_Char *XML_ExpatVersion(void)
+diff --git a/ext/xmlwriter/php_xmlwriter.c b/ext/xmlwriter/php_xmlwriter.c
+index df5bbe3555..d7ac7387b8 100644
+--- a/ext/xmlwriter/php_xmlwriter.c
++++ b/ext/xmlwriter/php_xmlwriter.c
+@@ -1004,7 +1004,8 @@ static void 
php_xmlwriter_flush(INTERNAL_FUNCTION_PARAMETERS, int force_string)
+               }
+               output_bytes = xmlTextWriterFlush(ptr);
+               if (buffer) {
+-                      RETVAL_STRING((char *) buffer->content);
++                      const xmlChar *content = xmlBufferContent(buffer);
++                      RETVAL_STRING((const char *) content);
+                       if (empty) {
+                               xmlBufferEmpty(buffer);
+                       }
diff --git a/missing-includes.patch b/missing-includes.patch
deleted file mode 100644
index 609b336..0000000
--- a/missing-includes.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff -ur php-8.2.12.orig/ext/dom/document.c php-8.2.12/ext/dom/document.c
---- php-8.2.12.orig/ext/dom/document.c 2023-10-24 21:22:16.000000000 +0200
-+++ php-8.2.12/ext/dom/document.c      2023-11-23 21:35:57.407063192 +0100
-@@ -23,6 +23,7 @@
- #if defined(HAVE_LIBXML) && defined(HAVE_DOM)
- #include "php_dom.h"
- #include <libxml/SAX.h>
-+#include <libxml/xmlsave.h>
- #ifdef LIBXML_SCHEMAS_ENABLED
- #include <libxml/relaxng.h>
- #include <libxml/xmlschemas.h>
-diff -ur php-8.2.12.orig/ext/libxml/php_libxml.h 
php-8.2.12/ext/libxml/php_libxml.h
---- php-8.2.12.orig/ext/libxml/php_libxml.h    2023-10-24 21:22:16.000000000 
+0200
-+++ php-8.2.12/ext/libxml/php_libxml.h 2023-11-23 21:35:57.407063192 +0100
-@@ -34,6 +34,7 @@
- #endif
- 
- #include "zend_smart_str.h"
-+#include <libxml/parser.h>
- #include <libxml/tree.h>
- 
- #define LIBXML_SAVE_NOEMPTYTAG 1<<2
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/php.git/commitdiff/1286b1831c3a84d236b290af0bcc38af06009094

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to