resolve some errors in php logic, like strlen with str containing space that is interpreted as array instead of string
This commit is contained in:
23
plug/map_prof/settings/mp_url_api.php
Normal file
23
plug/map_prof/settings/mp_url_api.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
function mp_url_api() {
|
||||
global $mp_api_key;
|
||||
$mp_url = array(
|
||||
'src' => 'https://maps.googleapis.com/maps/api/js',
|
||||
'key' => $mp_api_key,
|
||||
'callback' => 'mp_init_map',
|
||||
);
|
||||
$mp_src = "";
|
||||
foreach ($mp_url as $url_key => $url_value) {
|
||||
if ($url_key === 'src') {
|
||||
$mp_src .= $url_value;
|
||||
if (count($mp_url) > 1)
|
||||
$mp_src .= "?";
|
||||
}
|
||||
else
|
||||
$mp_src .= "&" . $url_key . "=" . $url_value;
|
||||
};
|
||||
|
||||
return $mp_src;
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user