diff options
Diffstat (limited to 'app/fn')
-rw-r--r-- | app/fn/fn.php | 3 |
1 files changed, 3 insertions, 0 deletions
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."); } |