X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fxml.php;h=c184b5099ed758a30c961cc20e5438489f3aa8b1;hb=93fd189198efe047d0f8642c2d6d0df49530e38b;hp=911109f0c46012d07278fbfe0907f498420a411b;hpb=951006dd10628151c8f108f82c3260f13846e557;p=friendica.git diff --git a/include/xml.php b/include/xml.php index 911109f0c4..c184b5099e 100644 --- a/include/xml.php +++ b/include/xml.php @@ -50,8 +50,8 @@ class xml { } } - foreach ($array as $key => $value) { - if (!isset($element) AND isset($xml)) { + foreach($array as $key => $value) { + if (!isset($element) && isset($xml)) { $element = $xml; } @@ -67,7 +67,7 @@ class xml { } $element_parts = explode(":", $key); - if ((count($element_parts) > 1) AND isset($namespaces[$element_parts[0]])) { + if ((count($element_parts) > 1) && isset($namespaces[$element_parts[0]])) { $namespace = $namespaces[$element_parts[0]]; } elseif (isset($namespaces[""])) { $namespace = $namespaces[""]; @@ -76,18 +76,18 @@ class xml { } // Remove undefined namespaces from the key - if ((count($element_parts) > 1) AND is_null($namespace)) { + if ((count($element_parts) > 1) && is_null($namespace)) { $key = $element_parts[1]; } if (substr($key, 0, 11) == "@attributes") { - if (!isset($element) OR !is_array($value)) { + if (!isset($element) || !is_array($value)) { continue; } foreach ($value as $attr_key => $attr_value) { $element_parts = explode(":", $attr_key); - if ((count($element_parts) > 1) AND isset($namespaces[$element_parts[0]])) { + if ((count($element_parts) > 1) && isset($namespaces[$element_parts[0]])) { $namespace = $namespaces[$element_parts[0]]; } else { $namespace = NULL; @@ -305,7 +305,7 @@ class xml { //Set the attributes too. if (isset($attributes) and $get_attributes) { foreach ($attributes as $attr => $val) { - if ($priority == 'tag') { + if($priority == 'tag') { $attributes_data[$attr] = $val; } else { $result['@attributes'][$attr] = $val; // Set all the attributes in a array called 'attr' @@ -323,7 +323,7 @@ class xml { if ($type == "open") { // The starting of the tag '' $parent[$level-1] = &$current; - if (!is_array($current) or (!in_array($tag, array_keys($current)))) { // Insert New tag + if (!is_array($current) || (!in_array($tag, array_keys($current)))) { // Insert New tag $current[$tag] = $result; if ($attributes_data) { $current[$tag. '_attr'] = $attributes_data; @@ -399,7 +399,7 @@ class xml { /** * @brief Delete a node in a XML object - * + * * @param object $doc XML document * @param string $node Node name */