From 35e428c077dac7e57e6f6833562c88ae4a9867da Mon Sep 17 00:00:00 2001 From: vincent-peugnet Date: Wed, 29 Apr 2020 01:28:38 +0200 Subject: feature : rename media fix #82 --- app/fn/fn.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'app/fn/fn.php') diff --git a/app/fn/fn.php b/app/fn/fn.php index 103062a..461f129 100644 --- a/app/fn/fn.php +++ b/app/fn/fn.php @@ -425,6 +425,9 @@ function accessfile(string $path, bool $createdir = false): bool if (!is_writable($dir)) { throw new \InvalidArgumentException("Directory '$dir' is not writable."); } + if (!file_exists($path)) { + throw new \InvalidArgumentException("The file '$path' does not exist."); + } if (is_file($path) && !is_writable($path)) { throw new \InvalidArgumentException("The file '$path' is not writable."); } -- cgit v1.2.3