aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engine/lib/filestore.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/engine/lib/filestore.php b/engine/lib/filestore.php
index cecb8d99a..f9e8a306a 100644
--- a/engine/lib/filestore.php
+++ b/engine/lib/filestore.php
@@ -157,6 +157,9 @@
// Try and create the directory
try { $this->make_directory_root($path); } catch (Exception $e){}
+ if (($mode!='write') && (!file_exists($fullname)))
+ return false;
+
switch ($mode)
{
case "read" : $mode = "r+b"; break;
@@ -165,11 +168,8 @@
default: throw new InvalidParameterException(sprintf(elgg_echo('InvalidParameterException:UnrecognisedFileMode'), $mode));
}
- if (file_exists($fullname)) {
- return fopen($fullname, $mode);
- } else {
- return false;
- }
+ return fopen($fullname, $mode);
+
}
public function write($f, $data)