From 81b908af157b8580cca92046dd4ad8772c61e4fb Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Mon, 29 Apr 2019 01:16:31 +0200 Subject: [PATCH] nieuws: alternate cover image for .groot file name Assume any picture with such extension has a corresponding version preferred as article thumbnail (cropped for smaller sizes). --- nieuws.inc.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nieuws.inc.php b/nieuws.inc.php index 1a68993..40432a9 100644 --- a/nieuws.inc.php +++ b/nieuws.inc.php @@ -113,7 +113,10 @@ class ArchiveArticle function thumb($size = '300x') { if (!$this->image or $this->image[0] !== '/') return; - return preg_replace('{^(?:/thumb/[^/]*)?}', "thumb/$size", $this->image); + return preg_replace( + ['{^(?:/thumb/[^/]*)?}', '/\.groot(?=\.\w+$)/'], ["thumb/$size", ''], + $this->image + ); } } -- 2.30.0