From: Mischa POSLAWSKY Date: Sun, 28 Apr 2019 23:22:49 +0000 (+0200) Subject: nieuws: ignore missing page description in new articles X-Git-Tag: v3.9~1 X-Git-Url: http://git.shiar.nl/minimedit.git/commitdiff_plain/c0f916285fa69edb97a6c8311f567b90b3959ed3 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]. --- 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) {