Ticket #506 (closed Bug: wontfix)

Opened 9 months ago

Last modified 9 months ago

Gmap simplexml_load_file()

Reported by: samsoffes Owned by: - No owner -
Priority: minor Milestone: 2.1.2
Component: Modules Version: SVN HEAD
Keywords: Cc:

Description

The address_to_xml method in the Gmap module uses simplexml_load_file() which throws and error for me at (mt). For most PHP installs, that is disabled by default. cURL is a much better option.

$url = 'http://maps.google.com/maps/geo?'.
	'&output=xml'.
	'&key='.$api_key.
	'&q='.rawurlencode($address);
				
$ch = curl_init();
$options[CURLOPT_URL] = $url;
$options[CURLOPT_RETURNTRANSFER] = true;
curl_setopt_array($ch, $options);
$output = curl_exec($ch);
curl_close($ch);
$xml = new SimpleXMLElement($output);

Attachments

MY_Gmap.php (1.6 kB) - added by samsoffes 9 months ago.
MY_Gmap

Change History

Changed 9 months ago by samsoffes

MY_Gmap

Changed 9 months ago by Shadowhand

  • status changed from new to closed
  • resolution set to wontfix

SimpleXML is enabled by default in PHP 5. From the PHP manual: "The SimpleXML extension is enabled by default. To disable it, use the --disable-simplexml configure option."

Remote fopen and friends are also enabled by default. Ask your host to enable them.

Note: See TracTickets for help on using tickets.