summaryrefslogtreecommitdiffstats
path: root/XML_Util-pr8.patch
diff options
context:
space:
mode:
Diffstat (limited to 'XML_Util-pr8.patch')
-rw-r--r--XML_Util-pr8.patch26
1 files changed, 26 insertions, 0 deletions
diff --git a/XML_Util-pr8.patch b/XML_Util-pr8.patch
new file mode 100644
index 0000000..2a41893
--- /dev/null
+++ b/XML_Util-pr8.patch
@@ -0,0 +1,26 @@
+From 59e2d9738dd25cd751b810e5431b96e836864152 Mon Sep 17 00:00:00 2001
+From: Remi Collet <fedora@famillecollet.com>
+Date: Wed, 22 Feb 2017 11:39:37 +0100
+Subject: [PATCH] Fix #21184, collapseEmptyTags breaks XML_Serializer
+
+---
+ XML/Util.php | 2 +-
+ package.xml | 1 +
+ tests/Bug21184Tests.php | 18 ++++++++++++++++++
+ 3 files changed, 20 insertions(+), 1 deletion(-)
+ create mode 100644 tests/Bug21184Tests.php
+
+diff --git a/XML/Util.php b/XML/Util.php
+index af8211b..0bb7e5e 100644
+--- a/XML/Util.php
++++ b/XML/Util.php
+@@ -483,7 +483,7 @@ public static function collapseEmptyTags($xml, $mode = XML_UTIL_COLLAPSE_ALL)
+ '${4}' . // attributes
+ ' />'
+ ;
+- return preg_replace($preg1, $preg2, $xml);
++ return (preg_replace($preg1, $preg2, $xml)?:$xml);
+ break;
+ case XML_UTIL_COLLAPSE_XHTML_ONLY:
+ return preg_replace(
+