Browse Source

fix: Rétablir la compatibilité avec PHP < 7

qui ne supporte pas l'opérateur null coalescent

Ref: https://discuter.spip.net/t/parse-error-syntax-error-unexpected-in-gis-v4-53-0/162115
pull/43/head
b_b 4 months ago
parent
commit
a49947f20b
  1. 6
      CHANGELOG.md
  2. 6
      gis_fonctions.php
  3. 2
      inc/staticmap.php

6
CHANGELOG.md

@ -1,5 +1,11 @@
# Changelog
## [Unreleased]
### Fixed
- Rétablir la compatibilité avec PHP < 7
## [4.53.0] - 2022-05-25
### Fixed

6
gis_fonctions.php

@ -552,10 +552,10 @@ function gis_static_map($id_gis, $width, $height, $maptype = false, $zoom = null
$gis = sql_fetsel('lat,lon,zoom', 'spip_gis', 'id_gis=' . intval($id_gis));
}
$zoom = $zoom ?? $gis['zoom'];
$zoom = isset($zoom) ? $zoom : $gis['zoom'];
$lat = $gis['lat'] ?? $lat;
$lon = $gis['lon'] ?? $lon;
$lat = isset($gis['lat']) ? $gis['lat'] : $lat;
$lon = isset($gis['lon']) ? $gis['lon'] : $lon;
if (intval($id_gis) and !$markers) {
$markers_[] = ['lat' => (float) $lat, 'lon' => (float) $lon];

2
inc/staticmap.php

@ -265,7 +265,7 @@ class staticMapGis
// set some local variables
$markerLat = $marker['lat'];
$markerLon = $marker['lon'];
$markerUrl = $marker['url'] ?? '';
$markerUrl = isset($marker['url']) ? $marker['url'] : '';
// clear variables from previous loops
$markerShadow = false;
// marker perso ou par défaut ?

Loading…
Cancel
Save