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:
asus
2023-11-08 16:13:25 +01:00
parent 036473d58f
commit 3429d5dda3
41 changed files with 2653 additions and 8 deletions

View 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;
}
?>