From: Mischa POSLAWSKY Date: Thu, 24 Oct 2019 21:54:05 +0000 (+0200) Subject: nieuws: avoid invalid date access for missing articles X-Git-Tag: v4.1~7 X-Git-Url: http://git.shiar.net/minimedit.git/commitdiff_plain/10c5940d15b49f8656c3c1b384f80f4c619d3d82 nieuws: avoid invalid date access for missing articles Broken since page objects introduced in commit v3.9-11-g234326791b (2019-06-28) [page: promote news article class to represent all pages]. --- diff --git a/nieuws/index.php b/nieuws/index.php index fbc6384..3a50265 100644 --- a/nieuws/index.php +++ b/nieuws/index.php @@ -11,7 +11,9 @@ if ($page and !is_numeric($page)) { if ($edit) { $Article->title = $edit; } - $Place[1] = ' '.$Article->date.''; + if ($Article->dateparts) { + $Place[1] = ' '.$Article->date.''; + } print preg_replace('{(?<=

)(.*?)(?=

)}', ($edit ?: '\1').' [[1]]', ob_get_clean()); if ($User and $User->admin('news')) { $taglist = [];