aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2018-05-01 10:34:23 +0200
committerMario Vavti <mario@mariovavti.com>2018-05-02 09:30:05 +0200
commit5c5ae2969e5465ff559b63532122611c315d88d9 (patch)
treed5f8793ec4a154cf08f4d10b611d283cc5c08a7f /include
parent3af691043dca48a788274bce86979b0c7df14a82 (diff)
downloadvolse-hubzilla-5c5ae2969e5465ff559b63532122611c315d88d9.tar.gz
volse-hubzilla-5c5ae2969e5465ff559b63532122611c315d88d9.tar.bz2
volse-hubzilla-5c5ae2969e5465ff559b63532122611c315d88d9.zip
Revert "Revert "hubzilla issue #1119 - xml2array has issues with some unicode sequences/conversions. Working around it using the older simplexml parser until it can be debugged, as Diaspora does not use complex XML with namespaces; which is where we need the more advaced capabilities of xml2array.""
This reverts commit b223e364c6221aa3c680505fda4acfd6a1790272.
Diffstat (limited to 'include')
-rw-r--r--include/network.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/network.php b/include/network.php
index 72f1dacaf..8b7490a8a 100644
--- a/include/network.php
+++ b/include/network.php
@@ -648,6 +648,7 @@ function parse_xml_string($s, $strict = true) {
libxml_use_internal_errors(true);
+
$x = @simplexml_load_string($s2);
if($x === false) {
logger('libxml: parse: error: ' . $s2, LOGGER_DATA);
@@ -661,6 +662,16 @@ function parse_xml_string($s, $strict = true) {
return $x;
}
+
+function sxml2array ( $xmlObject, $out = array () )
+{
+ foreach ( (array) $xmlObject as $index => $node )
+ $out[$index] = ( is_object ( $node ) ) ? sxml2array ( $node ) : $node;
+
+ return $out;
+}
+
+
/**
* @brief Scales an external image.
*