Skip to content

Commit

Permalink
Sometime, cans be an array and not directly a string - fix for php8
Browse files Browse the repository at this point in the history
  • Loading branch information
vbonamy committed Sep 5, 2024
1 parent e79de50 commit cab699c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,11 @@ function printOptionElement($IDProviders, $key, $selectedIDP){
}

function geoDataAttributes($GeolocationHint) {
// Sometime, $GeolocationHint cans be an array and not directly a string
if(is_array($GeolocationHint)) {
echo $GeolocationHint;
$GeolocationHint = array_pop(array_reverse($GeolocationHint));
}
if ($GeolocationHint &&
preg_match("/^(-?[0-9.]+),(-?[0-9.]+)$/", $GeolocationHint, $match)){
return sprintf(' data-lat="%s" data-lon="%s"', $match[1], $match[2]);
Expand Down

0 comments on commit cab699c

Please sign in to comment.