From 9816315e13355806d2e4cb4302a1f81de9c2af89 Mon Sep 17 00:00:00 2001 From: icewing Date: Thu, 1 May 2008 14:16:23 +0000 Subject: Marcus Povey * Bugfix: uses the correct filename git-svn-id: https://code.elgg.org/elgg/trunk@594 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/filestore.php | 19 ++++++++++++++----- mod/file/upload.php | 2 ++ 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/engine/lib/filestore.php b/engine/lib/filestore.php index 32b8a63ad..62de55b9e 100644 --- a/engine/lib/filestore.php +++ b/engine/lib/filestore.php @@ -333,7 +333,7 @@ */ public function open($mode) { - if (!$this->title) + if (!$this->getFilename()) throw new IOException("You must specify a name before opening a file."); // See if file has already been saved @@ -616,6 +616,15 @@ return true; } + + /** + * Run once and only once. + */ + function filestore_run_once() + { + // Register a class + add_subtype("object", "file", "ElggFile"); + } /** * Initialise the file modules. @@ -623,13 +632,13 @@ */ function filestore_init() { - // Register a class - add_subtype("object", "file", "ElggFile"); - // Now register a default filestore set_default_filestore(new ElggDiskFilestore($CONFIG->dataroot)); + + // Now run this stuff, but only once + run_function_once("filestore_run_once"); } // Register a startup event - register_event_handler('init','system','filestore_init',0); + register_event_handler('init','system','filestore_init',0); ?> \ No newline at end of file diff --git a/mod/file/upload.php b/mod/file/upload.php index d0e0a9901..51da6be3a 100644 --- a/mod/file/upload.php +++ b/mod/file/upload.php @@ -8,6 +8,8 @@ * @link http://elgg.com/ */ + gatekeeper(); + // Render the file upload page page_draw(elgg_echo("file:upload"), elgg_view("file/upload", NULL)); ?> \ No newline at end of file -- cgit v1.2.3