Skip to content
Extraits de code Groupes Projets
Valider 43d979d5 rédigé par marcimat's avatar marcimat
Parcourir les fichiers

Éviter une erreur d’exécution sur l’appel à LOGO_DOCUMENT si pas de document trouvé

parent c82e8d58
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -117,7 +117,7 @@ function vignette_automatique($img, $doc, $lien, $x = 0, $y = 0, $align = '', $c ...@@ -117,7 +117,7 @@ function vignette_automatique($img, $doc, $lien, $x = 0, $y = 0, $align = '', $c
if (is_null($class)) { if (is_null($class)) {
$class = 'spip_logo spip_logos'; $class = 'spip_logo spip_logos';
} }
$e = $doc['extension']; $e = $doc['extension'] ?? null;
if (!$img) { if (!$img) {
if ($img = image_du_document($doc, $connect)) { if ($img = image_du_document($doc, $connect)) {
if (!$x and !$y) { if (!$x and !$y) {
...@@ -179,7 +179,7 @@ function vignette_automatique($img, $doc, $lien, $x = 0, $y = 0, $align = '', $c ...@@ -179,7 +179,7 @@ function vignette_automatique($img, $doc, $lien, $x = 0, $y = 0, $align = '', $c
*/ */
function image_du_document($document, $connect = null) { function image_du_document($document, $connect = null) {
if ( if (
$e = $document['extension'] $e = $document['extension'] ?? null
and in_array($e, formats_image_acceptables()) and in_array($e, formats_image_acceptables())
and (!test_espace_prive() or $GLOBALS['meta']['creer_preview'] == 'oui') and (!test_espace_prive() or $GLOBALS['meta']['creer_preview'] == 'oui')
and $document['fichier'] and $document['fichier']
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter