[feature/attach-dl] Send 404 if we get empty row from privmsg|posts|topic table

PHPBB3-11042
This commit is contained in:
Andreas Fischer 2012-08-10 03:26:30 +02:00
parent ccb0baa20a
commit 62305bec6d

View file

@ -366,6 +366,12 @@ else
$row = $db->sql_fetchrow($result); $row = $db->sql_fetchrow($result);
$db->sql_freeresult($result); $db->sql_freeresult($result);
if (empty($row))
{
send_status_line(404, 'Not Found');
trigger_error('ERROR_NO_ATTACHMENT');
}
$bad_chars = array("'", "\\", ' ', '/', ':', '*', '?', '"', '<', '>', '|'); $bad_chars = array("'", "\\", ' ', '/', ':', '*', '?', '"', '<', '>', '|');
$clean_name = current($row); $clean_name = current($row);
$clean_name = rawurlencode(str_replace($bad_chars, '_', strtolower($clean_name))); $clean_name = rawurlencode(str_replace($bad_chars, '_', strtolower($clean_name)));