Commit b3c452da authored by lyricnz's avatar lyricnz
Browse files

Always return an empty result set, even for errors

parent 477f4241
......@@ -626,6 +626,7 @@ function geonames_query_required_parameters_set($service, $query, $single = 'sin
*/
function geonames_parse_xml($data, $columns = FALSE) {
$result = new stdClass();
$result->results = array();
// temporary solution; get stuff from XML tag to distinguish between pay-service and free service
preg_match('/<\?xml version="(.*)" encoding="([a-zA-Z\-0-9]*)"(.*)\?>/', $data, $regs);
......@@ -1072,6 +1073,9 @@ function theme_geonames_table($resultobj) {
* string, descending=DESC (ascending (ASC) is default)
*/
function _geonames_sort(&$results, $key, $order) {
if (empty($results)) {
return;
}
if (array_key_exists($key, $results[0])) {
global $_geonames_sort_by_key;
$_geonames_sort_by_key = $key;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment