浏览代码

! 4838] fix for potential wrong HTTP-Header creation

Spuds 13 年之前
父节点
当前提交
2ffed0715a
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Sources/Display.php

+ 1 - 1
Sources/Display.php

@@ -1276,7 +1276,7 @@ function Download()
 	{
 		loadLanguage('Errors');
 
-		header('HTTP/1.0 404 ' . $txt['attachment_not_found']);
+		header((preg_match('~HTTP/1\.[01]~i', $_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0') . ' 404 Not Found');
 		header('Content-Type: text/plain; charset=' . (empty($context['character_set']) ? 'ISO-8859-1' : $context['character_set']));
 
 		// We need to die like this *before* we send any anti-caching headers as below.