aboutsummaryrefslogtreecommitdiffstats
path: root/include/network.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-04-29 23:05:38 -0700
committerzotlabs <mike@macgirvin.com>2018-04-29 23:05:38 -0700
commite841e482589cfc8f9734e313350b6e2b78ea6940 (patch)
tree3222c2c2ce14252cf317a2d3984a1456d27dad24 /include/network.php
parentaa15867c9538e416aaa46de0fef8f2a92b69bf05 (diff)
downloadvolse-hubzilla-e841e482589cfc8f9734e313350b6e2b78ea6940.tar.gz
volse-hubzilla-e841e482589cfc8f9734e313350b6e2b78ea6940.tar.bz2
volse-hubzilla-e841e482589cfc8f9734e313350b6e2b78ea6940.zip
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.
Diffstat (limited to 'include/network.php')
-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.
*