page: retain thumb subhandlers over invalid resize
authorMischa POSLAWSKY <perl@shiar.org>
Wed, 9 Dec 2020 08:01:49 +0000 (09:01 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Sat, 19 Dec 2020 02:01:43 +0000 (03:01 +0100)
Ignore non-static files such as /thumb/qr on Lijtweg.

article.inc.php

index 30de51e770ba18bf9b2cb87a9b962a77d8674ff2..3e67d6f1a457d59a9646babcbe83f2aa242821eb 100644 (file)
@@ -149,6 +149,9 @@ class ArchiveArticle
        function thumb($size = '300x')
        {
                if (!$this->image or $this->image[0] !== '/') return;
+               if (preg_match('{^/thumb/\D}', $this->image)) {
+                       return ltrim($this->image, '/');
+               }
                return preg_replace(
                        ['{^(?:/thumb/[^/]*)?}', '/\.groot(?=\.\w+$)/'], ["thumb/$size", ''],
                        $this->image