From 5371f843d302e61eeec3b2f12edecaaeb4dcdc72 Mon Sep 17 00:00:00 2001 From: Jonas Elfering Date: Mon, 24 Oct 2022 14:32:04 +0200 Subject: [PATCH] Fix deprecation in file_get_contents call On PHP 8.1 this lib throws a deprecation warning, as it passes null as second param to `file_get_contents`, which should be a bool according to the method declaration. --- lib/FastImageSize.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/FastImageSize.php b/lib/FastImageSize.php index 64ab224..152d527 100644 --- a/lib/FastImageSize.php +++ b/lib/FastImageSize.php @@ -186,7 +186,7 @@ public function getImage($filename, $offset, $length, $forceLength = true) { if (empty($this->data)) { - $this->data = @file_get_contents($filename, null, null, $offset, $length); + $this->data = @file_get_contents($filename, false, null, $offset, $length); } // Force length to expected one. Return false if data length