add patch to fix XML_Serializer with XML_Util 1.4.1

from https://github.com/pear/XML_Util/pull/8
This commit is contained in:
Remi Collet 2017-02-22 12:01:49 +01:00
parent a99987d923
commit 708a4a047a
2 changed files with 35 additions and 2 deletions

26
XML_Util-pr8.patch Normal file
View File

@ -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(

View File

@ -27,7 +27,7 @@
Summary: PHP Extension and Application Repository framework
Name: php-pear
Version: 1.10.1
Release: 9%{?dist}
Release: 10%{?dist}
Epoch: 1
# PEAR, PEAR_Manpages, Archive_Tar, XML_Util, Console_Getopt are BSD
# Structures_Graph is LGPLv3+
@ -50,6 +50,8 @@ Source25: http://pear.php.net/get/PEAR_Manpages-%{manpages}.tgz
# https://github.com/pear/pear-core/pull/51
Patch0: pear-proxy.patch
# https://github.com/pear/XML_Util/pull/8
Patch1: XML_Util-pr8.patch
BuildArch: noarch
BuildRequires: php(language) > 5.4
@ -121,7 +123,7 @@ done
cp %{SOURCE1} .
# apply patches on used PEAR during install
# Patch0 applied on installation tree
# Patches applied on installation tree
sed -e 's:@BINDIR@:%{_bindir}:' \
-e 's:@LIBDIR@:%{_localstatedir}/lib:' \
@ -187,6 +189,7 @@ install -m 644 -D macros.pear \
# apply patches on installed PEAR tree
pushd $RPM_BUILD_ROOT%{peardir}
patch --no-backup --fuzz 0 -p1 < %{PATCH0}
patch --no-backup --fuzz 0 -p1 < %{PATCH1}
popd
# Why this file here ?
@ -293,6 +296,10 @@ fi
%changelog
* Wed Feb 22 2017 Remi Collet <remi@fedoraproject.org> 1:1.10.1-11
- add patch to fix XML_Serializer with XML_Util 1.4.1
from https://github.com/pear/XML_Util/pull/8
* Wed Feb 8 2017 Remi Collet <remi@fedoraproject.org> 1:1.10.1-10
- update XML_Util to 1.4.1