From a944c076d724fce3830024ca1c8599c0b9e4acb2 Mon Sep 17 00:00:00 2001 From: pezcurrel Date: Sun, 27 Oct 2024 09:39:45 +0100 Subject: [PATCH] Made the regexp for image alt extraction more generic --- gancioff | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gancioff b/gancioff index 3838538..23f0bcd 100755 --- a/gancioff +++ b/gancioff @@ -358,7 +358,7 @@ foreach ($feed->channel->item as $item) { $hash=$item->title.$item->pubDate; if (isset($item->enclosure[0]['url']) && isset($item->enclosure[0]['type']) && isset($item->enclosure[0]['length'])) { $file=['url'=>$item->enclosure[0]['url']->__toString(), 'type'=>$item->enclosure[0]['type']->__toString(), 'length'=>$item->enclosure[0]['length']->__toString()]; - if (preg_match('#([^description->__toString(),$matches)===1) $imgalt=trim($matches[1]); + if (preg_match('#]*alt="([^"]+)"#',$item->description->__toString(),$matches)===1) $imgalt=trim($matches[1]); $hash.=$item->enclosure[0]['url'].$item->enclosure[0]['type'].$item->enclosure[0]['length'].$imgalt; } if ($imgalt=='') $imgalt='Flyer dell’evento';