]> git.mxchange.org Git - friendica.git/blobdiff - include/network.php
Searching for tags has been enabled in all places. The tag detection has been improve...
[friendica.git] / include / network.php
index f6e6cc2a30825c189ab77f196f0780b39ac80586..1ecee598cf414f4b8d3b0f4c85d4b7b123b083c3 100644 (file)
@@ -918,7 +918,7 @@ function fix_contact_ssl_policy(&$contact,$new_policy) {
  * Return: The parsed XML in an array form. Use print_r() to see the resulting array structure.
  * Examples: $array =  xml2array(file_get_contents('feed.xml'));
  *              $array =  xml2array(file_get_contents('feed.xml', true, 1, 'attribute'));
- */ 
+ */
 
 function xml2array($contents, $namespaces = true, $get_attributes=1, $priority = 'attribute') {
     if(!$contents) return array();
@@ -976,7 +976,7 @@ function xml2array($contents, $namespaces = true, $get_attributes=1, $priority =
 
         $result = array();
         $attributes_data = array();
-        
+
         if(isset($value)) {
             if($priority == 'tag') $result = $value;
             else $result['value'] = $value; // Put the value in a assoc array if we are in the 'Attribute' mode
@@ -992,7 +992,7 @@ function xml2array($contents, $namespaces = true, $get_attributes=1, $priority =
 
         // See tag status and do the needed.
                if($namespaces && strpos($tag,':')) {
-                       $namespc = substr($tag,0,strrpos($tag,':')); 
+                       $namespc = substr($tag,0,strrpos($tag,':'));
                        $tag = strtolower(substr($tag,strlen($namespc)+1));
                        $result['@namespace'] = $namespc;
                }
@@ -1015,7 +1015,7 @@ function xml2array($contents, $namespaces = true, $get_attributes=1, $priority =
                 } else { // This section will make the value an array if multiple tags with the same name appear together
                     $current[$tag] = array($current[$tag],$result); // This will combine the existing item and the new item together to make an array
                     $repeated_tag_index[$tag.'_'.$level] = 2;
-                    
+
                     if(isset($current[$tag.'_attr'])) { // The attribute of the last(0th) tag must be moved as well
                         $current[$tag]['0_attr'] = $current[$tag.'_attr'];
                         unset($current[$tag.'_attr']);
@@ -1038,7 +1038,7 @@ function xml2array($contents, $namespaces = true, $get_attributes=1, $priority =
 
                     // ...push the new element into that array.
                     $current[$tag][$repeated_tag_index[$tag.'_'.$level]] = $result;
-                    
+
                     if($priority == 'tag' and $get_attributes and $attributes_data) {
                         $current[$tag][$repeated_tag_index[$tag.'_'.$level] . '_attr'] = $attributes_data;
                     }
@@ -1049,11 +1049,11 @@ function xml2array($contents, $namespaces = true, $get_attributes=1, $priority =
                     $repeated_tag_index[$tag.'_'.$level] = 1;
                     if($priority == 'tag' and $get_attributes) {
                         if(isset($current[$tag.'_attr'])) { // The attribute of the last(0th) tag must be moved as well
-                            
+
                             $current[$tag]['0_attr'] = $current[$tag.'_attr'];
                             unset($current[$tag.'_attr']);
                         }
-                        
+
                         if($attributes_data) {
                             $current[$tag][$repeated_tag_index[$tag.'_'.$level] . '_attr'] = $attributes_data;
                         }
@@ -1066,6 +1066,6 @@ function xml2array($contents, $namespaces = true, $get_attributes=1, $priority =
             $current = &$parent[$level-1];
         }
     }
-    
+
     return($xml_array);
-}  
+}