Jelajahi Sumber

Add response code validation
before call isset in the large array

Joanhey 6 tahun lalu
induk
melakukan
15a47a07a7
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  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;