nieuws: retain image attributes in overview thumbs
authorMischa POSLAWSKY <perl@shiar.org>
Thu, 8 Nov 2018 02:50:08 +0000 (03:50 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Thu, 8 Nov 2018 02:50:08 +0000 (03:50 +0100)
nieuws.inc.php

index e2985692018e3db8055a5d596082cefd7a2bc307..e5e1ffa3664c764d2a292c8da87be1311baafda9 100644 (file)
@@ -114,7 +114,9 @@ function shownews($input, $limit = 1000)
                $article = new ArchiveArticle($filename);
                print '<li>';
                if ($article->thumb) {
-                       printf('<img src="/%s" class="left" />', $article->thumb);
+                       $img = preg_replace('{(?<= \b src="/) [^"]* }x', $article->thumb, $article->img);
+                       $img = preg_replace('{(?= />$)}', ' class="left"', $img);
+                       print $img;
                }
                print '<article>';
                printf(