aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorTobias Diekershoff <tobias.diekershoff@gmx.net>2011-06-10 19:14:10 +0200
committerTobias Diekershoff <tobias.diekershoff@gmx.net>2011-06-10 19:14:10 +0200
commiteb6666e1563cef91843539d3b98dc4936c4cea1f (patch)
treee62d8b4af9cdd40e9bcc1eaafb108e97c6757a1b /boot.php
parent8390e8b19bf1797c8751c0d5c625a42c26dfc4eb (diff)
parent7c60701efc091945dd2ee14728263d8dae0f88b0 (diff)
downloadvolse-hubzilla-eb6666e1563cef91843539d3b98dc4936c4cea1f.tar.gz
volse-hubzilla-eb6666e1563cef91843539d3b98dc4936c4cea1f.tar.bz2
volse-hubzilla-eb6666e1563cef91843539d3b98dc4936c4cea1f.zip
Merge branch 'master' of git://github.com/friendika/friendika
Diffstat (limited to 'boot.php')
-rw-r--r--boot.php19
1 files changed, 13 insertions, 6 deletions
diff --git a/boot.php b/boot.php
index 8e8a2bc21..b94000b60 100644
--- a/boot.php
+++ b/boot.php
@@ -2788,16 +2788,23 @@ function lang_selector() {
if(! function_exists('parse_xml_string')) {
-function parse_xml_string($s) {
- if(! strstr($s,'<?xml'))
- return false;
- $s2 = substr($s,strpos($s,'<?xml'));
+function parse_xml_string($s,$strict = true) {
+ if($strict) {
+ if(! strstr($s,'<?xml'))
+ return false;
+ $s2 = substr($s,strpos($s,'<?xml'));
+ }
+ else
+ $s2 = $s;
libxml_use_internal_errors(true);
+
$x = @simplexml_load_string($s2);
- if(count(libxml_get_errors()))
+ if(! $x) {
+ logger('libxml: parse: error: ' . $s2, LOGGER_DATA);
foreach(libxml_get_errors() as $err)
logger('libxml: parse: ' . $err->code." at ".$err->line.":".$err->column." : ".$err->message, LOGGER_DATA);
- libxml_clear_errors();
+ libxml_clear_errors();
+ }
return $x;
}}