]> git.mxchange.org Git - friendica.git/blobdiff - boot.php
Merge branch 'master' of git://github.com/friendika/friendika
[friendica.git] / boot.php
index 8e8a2bc210a2a346f141d3905500d464a7a1789a..49247eb23fff4634679cd22fc7b17858d7941172 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -4,7 +4,7 @@ set_time_limit(0);
 ini_set('pcre.backtrack_limit', 250000);
 
 
-define ( 'FRIENDIKA_VERSION',      '2.2.1006' );
+define ( 'FRIENDIKA_VERSION',      '2.2.1012' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.21'    );
 define ( 'DB_UPDATE_VERSION',      1063      );
 
@@ -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;
 }}