nieuws: ignore missing title during edit
authorMischa POSLAWSKY <perl@shiar.org>
Tue, 20 Nov 2018 10:13:24 +0000 (11:13 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Fri, 23 Nov 2018 15:37:03 +0000 (16:37 +0100)
Silence fgets() warning for new articles since commit v3.7-8-gc2423a9cb3
(2018-10-27) [nieuws: prepend article header to page title].

nieuws/index.php

index d56758e55d7ca3c57f4dc2a4dbbe57e82486373a..cf63a63669868bcbd73f5b5e99fdbebf50d5cbe0 100644 (file)
@@ -11,7 +11,7 @@ if (!empty($User['admin'])) {
 if ($page and !is_numeric($page)) {
        $edit = !empty($User['admin']) ? htmlspecialchars(@$_GET['edit']) : NULL;
        $article = new ArchiveArticle("$Page$Args.html");
-       $Place['title'] = $article->title;
+       $Place['title'] = $edit ?: $article->title;
        $Place[1] = ' <small class="date">'.$article->date.'</small>';
        print preg_replace('{(?<=<h2>)(.*?)(?=</h2>)}', ($edit ?: '\1').' [[1]]', ob_get_clean());
        if ($article->file and $article->image) {