From: Mischa POSLAWSKY Date: Sat, 25 Aug 2018 23:52:01 +0000 (+0200) Subject: nieuws: replace existing thumb prefix in cover images X-Git-Tag: v3.7~13 X-Git-Url: http://git.shiar.net/minimedit.git/commitdiff_plain/c187ac6e57f58c4b3fb5e400e9ca3a61b5ec37f9 nieuws: replace existing thumb prefix in cover images Prevent duplicate resizing. --- diff --git a/nieuws.inc.php b/nieuws.inc.php index 438c282..79f718d 100644 --- a/nieuws.inc.php +++ b/nieuws.inc.php @@ -96,7 +96,7 @@ class ArchiveArticle function thumb($size = '300x') { if (!$this->image or $this->image[0] !== '/') return; - return "thumb/$size{$this->image}"; + return preg_replace('{^(?:/thumb/[^/]*)?}', "thumb/$size", $this->image); } }