From 82ce29ac5855f13e803556b14960af3b759dc14b Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Thu, 22 Apr 2010 07:25:28 -0400 Subject: [PATCH] [ticket/7782] Send 404 HTTP code when a nonexistent user/forum/topic is requested. PHPBB3-7782 --- phpBB/includes/functions.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 4f52c7c2ce..3886640b41 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3628,6 +3628,11 @@ function msg_handler($errno, $msg_text, $errfile, $errline) $user->setup(); } + if ($msg_text == 'NO_FORUM' || $msg_text == 'NO_TOPIC' || $msg_text == 'NO_USER') + { + header("HTTP/1.x 404 Not Found"); + } + $msg_text = (!empty($user->lang[$msg_text])) ? $user->lang[$msg_text] : $msg_text; $msg_title = (!isset($msg_title)) ? $user->lang['INFORMATION'] : ((!empty($user->lang[$msg_title])) ? $user->lang[$msg_title] : $msg_title);