Skip to content

Commit 509ef44

Browse files
committed
Fix php error for special config #39 #40
1 parent 4907f21 commit 509ef44

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

osmmap2.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,9 @@
237237
/* If the config include parameters get them */
238238
$zoom = isset($conf['osm_conf']['left_menu']['zoom']) ? $conf['osm_conf']['left_menu']['zoom'] : 2;
239239
$center = isset($conf['osm_conf']['left_menu']['center']) ? $conf['osm_conf']['left_menu']['center'] : '0,0';
240-
$center_lat = isset($center) ? explode(',', $center)[0] : 0;
241-
$center_lng = isset($center) ? explode(',', $center)[1] : 0;
240+
$center_arr = preg_split('/,/', $center);
241+
$center_lat = isset($center_arr) ? $center_arr[0] : 0;
242+
$center_lng = isset($center_arr) ? $center_arr[1] : 0;
242243

243244
/* If we have zoom and center coordonate, set it otherwise fallback default */
244245
$zoom = isset($_GET['zoom']) ? $_GET['zoom'] : $zoom;

0 commit comments

Comments
 (0)