From 5af57bb249fa7d41801f80d83a582a6673a25c52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Thu, 11 Aug 2022 10:59:34 +0200 Subject: [PATCH] RepositoryDir.file_get_contents(): return values - false=access denied - null=does not exist --- src/RepositoryDir.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/RepositoryDir.php b/src/RepositoryDir.php index 08f23fd0..769c59b8 100644 --- a/src/RepositoryDir.php +++ b/src/RepositoryDir.php @@ -82,13 +82,17 @@ class RepositoryDir extends RepositoryBase { function file_get_contents ($file) { if (substr($file, 0, 1) === '.' || preg_match("/\/\./", $file)) { - return null; + return false; } if (!$this->access($file)) { return false; } + if (!file_exists("{$this->path}/{$file}")) { + return null; + } + return file_get_contents("{$this->path}/{$file}"); }