1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-06 06:38:00 +02:00

Improved handling of missing news items.

This commit is contained in:
Cameron
2016-12-14 11:45:39 -08:00
parent d702ba6ace
commit c69a303bce

View File

@@ -1004,9 +1004,17 @@ class news_front
// $action = 'default';
//XXX item not found, redirect to avoid messing up search-engine data.
$defaultUrl = e107::getUrl()->create('news/list/items');
e107::getRedirect()->go($defaultUrl, null, 301);
exit;
// e107::getRedirect()->go(null, true, 404);
header("HTTP/1.0 404 Not Found",true,404);
require_once(e_LANGUAGEDIR.e_LANGUAGE."/lan_error.php");
$text = e107::getMessage()->setTitle(LAN_ERROR_7, E_MESSAGE_INFO)->addInfo("Perhaps you're looking for one of the news items below?")->render();
$this->action = 'all';
// $defaultUrl = e107::getUrl()->create('news/list/items');
$text .= $this->renderListTemplate();
return $text;
}