diff options
author | Friendika <info@friendika.com> | 2011-06-10 01:51:14 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-06-10 01:51:14 -0700 |
commit | 7c60701efc091945dd2ee14728263d8dae0f88b0 (patch) | |
tree | 054b0e893e244172062c24a58f57c95d0be67fce /boot.php | |
parent | b857a49bfeecc91eaa5a09c9b9ded5b84516bc6e (diff) | |
download | volse-hubzilla-7c60701efc091945dd2ee14728263d8dae0f88b0.tar.gz volse-hubzilla-7c60701efc091945dd2ee14728263d8dae0f88b0.tar.bz2 volse-hubzilla-7c60701efc091945dd2ee14728263d8dae0f88b0.zip |
fixed a few feed problems affecting activity objects/targets
Diffstat (limited to 'boot.php')
-rw-r--r-- | boot.php | 19 |
1 files changed, 13 insertions, 6 deletions
@@ -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; }} |