From 8ee260c1328650195ab935734f1cc35757fecddd Mon Sep 17 00:00:00 2001 From: garvinhicking Date: Tue, 16 Aug 2005 10:27:33 +0000 Subject: [PATCH] Fix Bug #1260667: Do not show title of an entry, when draft. --- docs/NEWS | 3 +++ index.php | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/NEWS b/docs/NEWS index 495b1a4..c6de0bb 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -3,6 +3,9 @@ Version 0.8.4 () ------------------------------------------------------------------------ + * Hide title of an entry in the frontend, if entry is draft and not + displayed. Fixes Bug #1260667 (garvinhicking) + * Unbundle Serendipity XML-RPC functions from the bundled distribution. You will now need to install the additional plugin "Post via XML-RPC" (serendipity_event_xmlrpc) to make entry posts via this interface. diff --git a/index.php b/index.php index 70ee5df..e4ec910 100644 --- a/index.php +++ b/index.php @@ -164,9 +164,11 @@ if (preg_match(PAT_ARCHIVES, $uri, $matches) || isset($serendipity['GET']['range $_GET['serendipity']['action'] = 'read'; $_GET['serendipity']['id'] = $id; - $title = serendipity_db_query("SELECT title FROM {$serendipity['dbPrefix']}entries WHERE id=$id", true); - $serendipity['head_title'] = $title[0]; - $serendipity['head_subtitle'] = $serendipity['blogTitle']; + $title = serendipity_db_query("SELECT title FROM {$serendipity['dbPrefix']}entries WHERE id=$id WHERE e.isdraft = 'false' " . (!serendipity_db_bool($serendipity['showFutureEntries']) ? " AND e.timestamp <= " . time() : ''), true); + if (is_array($title)) { + $serendipity['head_title'] = $title[0]; + $serendipity['head_subtitle'] = $serendipity['blogTitle']; + } ob_start(); include_once(S9Y_INCLUDE_PATH . 'include/genpage.inc.php'); -- 2.39.5