From f631b83fb144b4b9a003ca7562366764b3e1bdce Mon Sep 17 00:00:00 2001 From: RealAngeleno Date: Mon, 27 Feb 2023 14:32:28 -0800 Subject: [PATCH] fix issues with the banner script not working PHP 7.4 Notice: Trying to access array offset on value of type resource in on line 13 Notice: Trying to access array offset on value of type resource in on line 14 Notice: fpassthru(): read of 8192 bytes failed with errno=21 Is a directory in on line 17 --- b.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/b.php b/b.php index 541fb1b2..83285b81 100644 --- a/b.php +++ b/b.php @@ -10,8 +10,9 @@ $fp = fopen($dir . $name, 'rb'); header('Cache-Control: no-cache, no-store, must-revalidate'); // HTTP 1.1 header('Pragma: no-cache'); // HTTP 1.0 header('Expires: 0'); // Proxies -header('Content-Type: ' . $fp['type']); -header('Content-Length: ' . $fp['bytes']); +$fstat = fstat($fp); +header('Content-Type: ' . mime_content_type($dir . $name)); +header('Content-Length: ' . $fstat['size']); // dump the picture and stop the script fpassthru($fp);