0004-mod_xml2enc-remove-dependency-on-xmlstring-header.patch 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. From 27a68e54b7c6d2ae80dca396fd2727852897dab1 Mon Sep 17 00:00:00 2001
  2. From: Eric Covener <covener@apache.org>
  3. Date: Tue, 21 Nov 2023 12:58:47 +0000
  4. Subject: [PATCH] mod_xml2enc: remove dependency on xmlstring header
  5. Submitted by: ttachi <tachihara@hotmail.com>
  6. Github: closes #393
  7. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1914013 13f79535-47bb-0310-9956-ffa450edef68
  8. Upstream: https://github.com/apache/httpd/commit/27a68e54b7c6d2ae80dca396fd2727852897dab1
  9. Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
  10. ---
  11. changes-entries/xmlchar.txt | 2 ++
  12. modules/filters/mod_xml2enc.c | 6 +++---
  13. 2 files changed, 5 insertions(+), 3 deletions(-)
  14. create mode 100644 changes-entries/xmlchar.txt
  15. diff --git a/changes-entries/xmlchar.txt b/changes-entries/xmlchar.txt
  16. new file mode 100644
  17. index 00000000000..d0e06300411
  18. --- /dev/null
  19. +++ b/changes-entries/xmlchar.txt
  20. @@ -0,0 +1,2 @@
  21. + *) mod_xml2enc: Tolerate libxml2 2.12.0 and later.
  22. + [ttachi <tachihara AT hotmail.com>]
  23. diff --git a/modules/filters/mod_xml2enc.c b/modules/filters/mod_xml2enc.c
  24. index 34f8e8ee090..e8ee2647955 100644
  25. --- a/modules/filters/mod_xml2enc.c
  26. +++ b/modules/filters/mod_xml2enc.c
  27. @@ -206,11 +206,11 @@ static void sniff_encoding(request_rec* r, xml2ctx* ctx)
  28. }
  29. }
  30. }
  31. -
  32. +
  33. /* to sniff, first we look for BOM */
  34. if (ctx->xml2enc == XML_CHAR_ENCODING_NONE) {
  35. - ctx->xml2enc = xmlDetectCharEncoding((const xmlChar*)ctx->buf,
  36. - ctx->bytes);
  37. + ctx->xml2enc = xmlDetectCharEncoding((const unsigned char*)ctx->buf,
  38. + ctx->bytes);
  39. if (HAVE_ENCODING(ctx->xml2enc)) {
  40. ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, APLOGNO(01432)
  41. "Got charset from XML rules.") ;