In index.php the html-title is set for existing entries, for non-existing entries a 404-header gets generated. However this does not seem to be the right place to check for the public/private setting on entries.
In /include/genpage.inc.php after
Code: Select all
switch ($serendipity['GET']['action']) {
// User wants to read the diary
case 'read':
if (isset($serendipity['GET']['id'])) {
$entry = array(serendipity_fetchEntry('id', $serendipity['GET']['id']));
if (!is_array($entry) || count($entry) < 1) {
unset($serendipity['GET']['id']);
$entry = array(array());
}
Code: Select all
else if (!is_array($entry[0])) {
$serendipity['head_title'] = htmlspecialchars($serendipity['blogTitle']);
$serendipity['head_subtitle'] = '';
$serendipity['smarty']->assign('head_title', $serendipity['head_title']);
$serendipity['smarty']->assign('head_subtitle', $serendipity['head_subtitle']);
header('HTTP/1.0 404 Not found');
}
genpage.inc.php may also not be the best place to do this. The _fetchentry-function in /include/functions_entries.inc.php may be a better place, but setting the 404-header there seems a bit unclean.