4892: WeblinksParser.parser() should return a result; endElement() does not use ...
authorTJ <acontent@iam.tj>
Thu, 20 Oct 2011 13:04:09 +0000 (14:04 +0100)
committerTJ <acontent@iam.tj>
Thu, 20 Oct 2011 13:42:01 +0000 (14:42 +0100)
include/classes/Weblinks/WeblinksParser.class.php

index 8e0a004..544f235 100644 (file)
@@ -40,9 +40,11 @@ class WeblinksParser {
        // public
        // @return      true if parsed successfully, false otherwise
        function parse($xml_data) {
+               $result = false;
                $this->element_path   = array();
                $this->character_data = '';
-               xml_parse($this->parser, $xml_data, TRUE);              
+               $result = xml_parse($this->parser, $xml_data, TRUE);
+               return $result;
        }
 
        // private
@@ -62,7 +64,6 @@ class WeblinksParser {
        function endElement($parser, $name) {
                //check element path
                $current_pos = count($this->element_path) - 1;
-               $last_element = $this->element_path[$current_pos - 1];
 
                switch($name) {
                        case 'title':