From c0f916285fa69edb97a6c8311f567b90b3959ed3 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Mon, 29 Apr 2019 01:22:49 +0200 Subject: [PATCH] nieuws: ignore missing page description in new articles Silence PHP warnings on article creation since v3.8-15-g628a397729 (2019-03-02) [nieuws: first paragraph teaser as page description] in the same fashion as commit v3.6-26-ge6d26c2062 (2018-09-17) [nieuws: ignore missing image/contents of new articles]. --- nieuws/index.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nieuws/index.php b/nieuws/index.php index 71048d5..21ee366 100644 --- a/nieuws/index.php +++ b/nieuws/index.php @@ -12,7 +12,9 @@ if ($page and !is_numeric($page)) { $edit = !empty($User['admin']) ? htmlspecialchars(@$_GET['edit']) : NULL; $article = new ArchiveArticle("$Page$Args.html"); $Place['title'] = $edit ?: $article->title; - $Place['description'] = $article->teaser; + if ($article->file) { + $Place['description'] = $article->teaser; + } $Place[1] = ' '.$article->date.''; print preg_replace('{(?<=

)(.*?)(?=

)}', ($edit ?: '\1').' [[1]]', ob_get_clean()); if ($article->file and $article->image) { -- 2.30.0