Disable XML Parsing Error at X:XX. Error 76: Mismatched tag

Error: XML Parsing Error at X:XX. Error 76: Mismatched tag
Joomla version: 1.5.8


Name: RokWeather
Author: RocketTheme, LLC
Creation Date: November 18, 2009
Author Email: @EMAIL@
Author Url: http://rocketwerx.com
Copyright: (C) 2009 RocketTheme, LLC. All rights reserved.
License: http://www.gnu.org/copyleft/gpl.html GNU/GPL
Version: 0.7
Description: RokWeather is a weather module based on Google data


Cause of this problem came from before loadString them not check XML tag is correct or not


File: mod_rockweather>googleweather.class.php

$xml = new JSimpleXML();

$xml->loadString($this->raw_data);


to



$xml = new JSimpleXML();
$parser = xml_parser_create('');
xml_set_object($parser);
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);


// If xml tag has some mistake from google
if(!xml_parse($parser, $this->raw_data))
{
    // Display error in rockweather
    $return_array['error'] = "Provider has maintenance the system.";
    return $return_array;
}
else
{
    $xml->loadString($this->raw_data);
}
xml_parser_free($parser);


# Enjoy your coding :)

Comments