nieuws: avoid invalid date access for missing articles
authorMischa POSLAWSKY <perl@shiar.org>
Thu, 24 Oct 2019 21:54:05 +0000 (23:54 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Sat, 9 Nov 2019 06:08:13 +0000 (07:08 +0100)
Broken since page objects introduced in commit v3.9-11-g234326791b
(2019-06-28) [page: promote news article class to represent all pages].

nieuws/index.php

index fbc638473d07e9ebcb5c7473c347ad4133e03981..3a50265955977b618d71c73c28cf5afea7151a01 100644 (file)
@@ -11,7 +11,9 @@ if ($page and !is_numeric($page)) {
        if ($edit) {
                $Article->title = $edit;
        }
-       $Place[1] = ' <small class="date">'.$Article->date.'</small>';
+       if ($Article->dateparts) {
+               $Place[1] = ' <small class="date">'.$Article->date.'</small>';
+       }
        print preg_replace('{(?<=<h2>)(.*?)(?=</h2>)}', ($edit ?: '\1').' [[1]]', ob_get_clean());
        if ($User and $User->admin('news')) {
                $taglist = [];