aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/filestore.php
diff options
context:
space:
mode:
authoricewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-10 12:23:48 +0000
committericewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-10 12:23:48 +0000
commit4419e9312d8c2c7ae792d3e0455df426a3c89440 (patch)
tree33c56d9d4c8c6a4bb45a599fa92a60bb56bff216 /engine/lib/filestore.php
parentfb3405482150f456c4fcf085768158feb672c6f2 (diff)
downloadelgg-4419e9312d8c2c7ae792d3e0455df426a3c89440.tar.gz
elgg-4419e9312d8c2c7ae792d3e0455df426a3c89440.tar.bz2
Marcus Povey <marcus@dushka.co.uk>
* Bugfix on filestore git-svn-id: https://code.elgg.org/elgg/trunk@846 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/filestore.php')
-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)