Browse Source

Warnings en moins lors de l'upload d'un document

Fix #30
pull/35/head
b_b 1 year ago committed by Gitea
parent
commit
d9a93732a3
  1. 21
      gis_pipelines.php
  2. 4
      inc/iptc.php

21
gis_pipelines.php

@ -173,15 +173,18 @@ function gis_post_edition($flux) {
$codesiptc = $er->h_codesIptc;
$string_recherche = '';
if ($iptc['city']) {
$string_recherche .= $iptc['city'] . ', ';
}
if ($iptc['provinceState']) {
$string_recherche .= $iptc['provinceState'] . ', ';
}
if ($iptc['country']) {
$string_recherche .= $iptc['country'];
if ($iptc && is_array($iptc)) {
if ($iptc['city']) {
$string_recherche .= $iptc['city'] . ', ';
}
if ($iptc['provinceState']) {
$string_recherche .= $iptc['provinceState'] . ', ';
}
if ($iptc['country']) {
$string_recherche .= $iptc['country'];
}
}
if (strlen($string_recherche)) {
include_spip('inc/gis_geocode');
$json = gis_geocode_request('search', [
@ -210,7 +213,7 @@ function gis_post_edition($flux) {
}
}
}
if (is_numeric($latitude) && is_numeric($longitude)) {
if ((isset($latitude) && is_numeric($latitude)) && (isset($longitude) && is_numeric($longitude))) {
$c = [
'titre' => basename($fichier),
'lat' => $latitude,

4
inc/iptc.php

@ -163,7 +163,7 @@ function fct_lireIPTC()
foreach ($tblIPTC as $codeIPTC => $valeurIPTC) {
$codeIPTC = str_replace("2#", "", $codeIPTC);
if( ($codeIPTC != "000") && ($codeIPTC != "140") && $this->h_codesIptc["$codeIPTC"])
if( ($codeIPTC != "000") && ($codeIPTC != "140") && in_array($codeIPTC, $this->h_codesIptc))
{
foreach ($valeurIPTC as $index => $v) {
if ($this->h_codesIptc["$codeIPTC"]) $codeIPTC = $this->h_codesIptc["$codeIPTC"];
@ -173,7 +173,7 @@ function fct_lireIPTC()
}
}
if(is_array($lesIptc)) return $lesIptc;
if(isset($lesIptc) && is_array($lesIptc)) return $lesIptc;
else return false;
}

Loading…
Cancel
Save