Notices en PHP 8.2
Au moins 2 à chaque fois sur le retour de ->tagAttribute
si le tag n’existe pas (null) passé dans une autre fonction qui attend un string.
diff --git a/lib/AdaptiveImages/AdaptiveImages.php b/lib/AdaptiveImages/AdaptiveImages.php
index 70c254f..c2e80ce 100644
--- a/lib/AdaptiveImages/AdaptiveImages.php
+++ b/lib/AdaptiveImages/AdaptiveImages.php
@@ -957,7 +957,7 @@ JS;
* @return string
*/
protected function imgAdaptiveMarkup($img, $bkptImages, $width, $height, $extension, $maxWidth1x, $sizes = null, $asBackground = false){
- $class = $this->tagAttribute($img, "class");
+ $class = $this->tagAttribute($img, "class") ?? '';
if (!$width or strpos($class, "adapt-img")!==false){
return $img;
}
@@ -1886,7 +1886,7 @@ SVG;
}
$ret = array();
- $source = trim($this->tagAttribute($img, 'src'));
+ $source = trim($this->tagAttribute($img, 'src') ?? '');
if (strlen($source)<1){
$source = $img;
$img = "<img src='$source' />";