diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-06-05 15:15:47 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-06-05 15:15:47 +0000 |
commit | 0e1ef1156515b7b7b524fa9d676122c93be1e938 (patch) | |
tree | 681316925ac71216c9381ee84f9975a9eccec621 /engine/lib/filestore.php | |
parent | 0ae667cf5970d93660b32d38e438f83fb73fdff9 (diff) | |
download | elgg-0e1ef1156515b7b7b524fa9d676122c93be1e938.tar.gz elgg-0e1ef1156515b7b7b524fa9d676122c93be1e938.tar.bz2 |
Further cleanup
git-svn-id: https://code.elgg.org/elgg/trunk@806 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/filestore.php')
-rw-r--r-- | engine/lib/filestore.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/engine/lib/filestore.php b/engine/lib/filestore.php index 0ade1e906..cecb8d99a 100644 --- a/engine/lib/filestore.php +++ b/engine/lib/filestore.php @@ -164,8 +164,12 @@ case "append" : $mode = "a+b"; break; default: throw new InvalidParameterException(sprintf(elgg_echo('InvalidParameterException:UnrecognisedFileMode'), $mode)); } - - return fopen($fullname, $mode); +
+ if (file_exists($fullname)) { + return fopen($fullname, $mode);
+ } else {
+ return false;
+ } } public function write($f, $data) @@ -232,7 +236,8 @@ * @param string $dirroot */ protected function make_directory_root($dirroot) - { + {
+ if (!file_exists($dirroot)) if (!@mkdir($dirroot, 0700, true)) throw new IOException(sprintf(elgg_echo('IOException:CouldNotMake'), $dirroot)); |