nieuws: hide text after cover image in overviews
authorMischa POSLAWSKY <perl@shiar.org>
Fri, 23 Nov 2018 15:28:15 +0000 (16:28 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Fri, 23 Nov 2018 15:28:15 +0000 (16:28 +0100)
Find standalone image at any position, and cut following contents in body.

nieuws.inc.php

index e5e1ffa3664c764d2a292c8da87be1311baafda9..b58def7b7302bdad9ac4e41cc7e93c1155d6cbb2 100644 (file)
@@ -78,7 +78,7 @@ class ArchiveArticle
        {
                $this->title;
                $rest = fread($this->file, filesize($this->page));
-               if ( preg_match('{\n<p>(<img [^>]*>)</p>\s*\z}', $rest, $img, PREG_OFFSET_CAPTURE) ) {
+               if ( preg_match('{\n<p>(<img [^>]*>)</p>}', $rest, $img, PREG_OFFSET_CAPTURE) ) {
                        $this->img = $img[1][0];
                        return substr($rest, 0, $img[0][1]);
                }