瀏覽代碼

Add response code validation
before call isset in the large array

Joanhey 6 年之前
父節點
當前提交
15a47a07a7
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Protocols/Http.php

+ 1 - 1
Protocols/Http.php

@@ -299,7 +299,7 @@ class Http
             $http_response_code = 302;
         }
 
-        if (isset(HttpCache::$codes[$http_response_code])) {
+        if ($http_response_code && isset(HttpCache::$codes[$http_response_code])) {
             HttpCache::$header['Http-Code'] = "HTTP/1.1 $http_response_code " . HttpCache::$codes[$http_response_code];
             if ($key === 'Http-Code') {
                 return true;