@@ -190,14 +190,19 @@ |
||
190 | 190 | global $mapit_ids; |
191 | 191 | $file = web_lookup(OPTION_MAPIT_URL . $filename); |
192 | 192 | $r = json_decode($file); |
193 | - if (isset($r->error)) return ''; |
|
194 | - if ($type == 'postcode' && !isset($r->areas)) return ''; |
|
193 | + if (isset($r->error)) { |
|
194 | + return ''; |
|
195 | + } |
|
196 | + if ($type == 'postcode' && !isset($r->areas)) { |
|
197 | + return ''; |
|
198 | + } |
|
195 | 199 | |
196 | 200 | $input = ($type == 'postcode') ? $r->areas : $r; |
197 | 201 | $areas = array(); |
198 | 202 | foreach ($input as $row) { |
199 | - if (in_array($row->type, array('WMC', 'WMCF', 'SPC', 'SPE', 'NIE', 'WAC', 'WAE'))) |
|
200 | - $areas[$row->type] = $row->name; |
|
203 | + if (in_array($row->type, array('WMC', 'WMCF', 'SPC', 'SPE', 'NIE', 'WAC', 'WAE'))) { |
|
204 | + $areas[$row->type] = $row->name; |
|
205 | + } |
|
201 | 206 | if ($row->type == 'WMC') { |
202 | 207 | $mapit_ids['old'] = $row->id; |
203 | 208 | } |