Browse Source

RepositoryDir.file_get_contents(): return values

- false=access denied
- null=does not exist
master
parent
commit
5af57bb249
  1. 6
      src/RepositoryDir.php

6
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}");
}

Loading…
Cancel
Save