From 62305bec6dbb660eaa51f629de2f70341df12666 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Fri, 10 Aug 2012 03:26:30 +0200 Subject: [PATCH] [feature/attach-dl] Send 404 if we get empty row from privmsg|posts|topic table PHPBB3-11042 --- phpBB/download/file.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/phpBB/download/file.php b/phpBB/download/file.php index c9fcf67101..282708f846 100644 --- a/phpBB/download/file.php +++ b/phpBB/download/file.php @@ -366,6 +366,12 @@ else $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); + if (empty($row)) + { + send_status_line(404, 'Not Found'); + trigger_error('ERROR_NO_ATTACHMENT'); + } + $bad_chars = array("'", "\\", ' ', '/', ':', '*', '?', '"', '<', '>', '|'); $clean_name = current($row); $clean_name = rawurlencode(str_replace($bad_chars, '_', strtolower($clean_name)));