]> git.mxchange.org Git - friendica.git/blobdiff - include/xml.php
Issue 3857: There is the possibility of a bad handling of dislikes
[friendica.git] / include / xml.php
index 911109f0c46012d07278fbfe0907f498420a411b..c184b5099ed758a30c961cc20e5438489f3aa8b1 100644 (file)
@@ -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 '<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
         */