From 8605232e87119c27b0e5f88b791649150a58a1d8 Mon Sep 17 00:00:00 2001 From: Mark Ruys Date: Tue, 13 Nov 2018 15:09:57 +0100 Subject: [PATCH] Suppress warning in case a blob is uploaded --- spaces.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spaces.php b/spaces.php index 818f238..5714bff 100644 --- a/spaces.php +++ b/spaces.php @@ -259,7 +259,8 @@ class SpacesConnect { if($access == "public") { $access = "public-read"; } - if(!is_file($pathToFile)){ + $is_file = strlen($pathToFile) <= PHP_MAXPATHLEN && is_file($pathToFile); + if(!$is_file){ $file = $pathToFile; }else{ $file = fopen($pathToFile, 'r+'); @@ -283,7 +284,7 @@ class SpacesConnect { catch (\Exception $e) { $this->HandleAWSException($e); } finally { - if (is_file($pathToFile)) { + if ($is_file) { fclose($file); } }