summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGunnar Wrobel <wrobel@pardus.de>2009-04-02 09:48:45 (GMT)
committerGunnar Wrobel <wrobel@pardus.de>2009-04-02 09:48:45 (GMT)
commitd4017c23e94fcac77c0ddaf45be4b133d366761c (patch)
tree13554e81a7c05b198c7c18465504cf3e5b35d9fa
parent1c5ae64941644130177d102c12b3e3606b3af563 (diff)
downloadserver-d4017c23e94fcac77c0ddaf45be4b133d366761c.tar.gz
Second attempt at fixing kolab/issue3525 (free/busy regeneration aborts for unparsable events). Also contains a fix for kolab/issue3528 (Events with broken encoding should work).
-rw-r--r--php-kolab/Kolab_Format/Kolab_Format.spec2
-rw-r--r--php-kolab/Kolab_Format/issue3525.patch83
2 files changed, 79 insertions, 6 deletions
diff --git a/php-kolab/Kolab_Format/Kolab_Format.spec b/php-kolab/Kolab_Format/Kolab_Format.spec
index a87f752..8e3f6ad 100644
--- a/php-kolab/Kolab_Format/Kolab_Format.spec
+++ b/php-kolab/Kolab_Format/Kolab_Format.spec
@@ -42,7 +42,7 @@ A package for reading/writing Kolab data formats.
%prep
%setup -n %{V_package}-%{V_version}
- %patch -p3 -P 0
+ %patch -p2 -P 0
cat ../package.xml | sed -e 's/md5sum="[^"]*"//' > package.xml
diff --git a/php-kolab/Kolab_Format/issue3525.patch b/php-kolab/Kolab_Format/issue3525.patch
index 4e83fc5..9a308c3 100644
--- a/php-kolab/Kolab_Format/issue3525.patch
+++ b/php-kolab/Kolab_Format/issue3525.patch
@@ -1,12 +1,85 @@
-diff --git a/framework/Kolab_Format/lib/Horde/Kolab/Format/XML.php b/framework/Kolab_Format/lib/Horde/Kolab/Format/XML.php
-index 03a5318..0a9859e 100644
---- a/framework/Kolab_Format/lib/Horde/Kolab/Format/XML.php
-+++ b/framework/Kolab_Format/lib/Horde/Kolab/Format/XML.php
-@@ -416,6 +416,6 @@ class Horde_Kolab_Format_XML
+From: Gunnar Wrobel <p@rdus.de>
+Subject: [PATCH] t/Kolab_Format/HK/GW/HandleEmptyXmlParserReturn
+
+Correct handling of empty return values from the XML parser. An empty
+return might occur if the XML document is broken (e.g. broken encoding).
+
+ISSUE: kolab/issue3520 (calendar with certain entries does not display in web client)
+ISSUE: kolab/issue3525 (free/busy regeneration aborts for unparsable events)
+ISSUE: kolab/issue3528 (Events with broken encoding should work)
+
+LINK: https://www.intevation.de/roundup/kolab/issue3520
+LINK: https://www.intevation.de/roundup/kolab/issue3525
+LINK: https://www.intevation.de/roundup/kolab/issue3528
+
+STATUS: COMMIT
+
+REF:
+
+Signed-off-by: Gunnar Wrobel <p@rdus.de>
+
+---
+ horde-webmail/lib/Horde/Kolab/Format/XML.php | 14 ++++++++++++--
+ 1 files changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/horde-webmail/lib/Horde/Kolab/Format/XML.php b/horde-webmail/lib/Horde/Kolab/Format/XML.php
+index d3d7def..30320c9 100644
+--- a/horde-webmail/lib/Horde/Kolab/Format/XML.php
++++ b/horde-webmail/lib/Horde/Kolab/Format/XML.php
+@@ -364,6 +364,9 @@ class Horde_Kolab_Format_XML
+ /**
+ * Load an object based on the given XML string.
+ *
++ * @todo Check encoding of the returned array. It seems to be ISO-8859-1 at
++ * the moment and UTF-8 would seem more appropriate.
++ *
+ * @param string $xmltext The XML of the message as string.
+ *
+ * @return array|PEAR_Error The data array representing the object.
+@@ -371,7 +374,10 @@ class Horde_Kolab_Format_XML
function load(&$xmltext)
{
$noderoot = $this->_parseXml($xmltext);
- if ($noderoot === false) {
++ if (is_a($noderoot, 'PEAR_Error')) {
++ return $noderoot;
++ }
+ if (empty($noderoot)) {
return false;
}
+
+@@ -530,9 +536,13 @@ class Horde_Kolab_Format_XML
+ */
+ function _parseXml(&$xmltext)
+ {
++ if (strcasecmp(mb_detect_encoding($xmltext, 'UTF-8, ISO-8859-1'), 'UTF-8') !== 0) {
++ $xmltext = mb_convert_encoding($xmltext, 'UTF-8', 'ISO-8859-1');
++ }
++
+ $params = array(
+ 'xml' => $xmltext,
+- 'options' => HORDE_DOM_LOAD_REMOVE_BLANKS,
++ 'options' => HORDE_DOM_LOAD_REMOVE_BLANKS | HORDE_DOM_LOAD_RECOVER,
+ );
+
+ $result = Horde_DOM_Document::factory($params);
+--
+tg: (2d1588f..) t/Kolab_Format/HK/GW/HandleEmptyXmlParserReturn (depends on: t/kronolith/HK/GW/XfbAccess)
+--
+TOPGIT patch commit log
+=======================
+
+commit 1883efc257b2e50646e11da79cc47fb0f7f328ca
+Author: Gunnar Wrobel <p@rdus.de>
+Date: Thu Apr 2 11:36:17 2009 +0200
+
+ Correct handling of empty return values from the XML parser. An empty
+ return might occur if the XML document is broken (e.g. broken encoding).
+
+ ISSUE: kolab/issue3520 (calendar with certain entries does not display in web client)
+ ISSUE: kolab/issue3525 (free/busy regeneration aborts for unparsable events)
+ ISSUE: kolab/issue3528 (Events with broken encoding should work)
+
+ LINK: https://www.intevation.de/roundup/kolab/issue3520
+ LINK: https://www.intevation.de/roundup/kolab/issue3525
+ LINK: https://www.intevation.de/roundup/kolab/issue3528