From 0e1ef1156515b7b7b524fa9d676122c93be1e938 Mon Sep 17 00:00:00 2001 From: ben Date: Thu, 5 Jun 2008 15:15:47 +0000 Subject: Further cleanup git-svn-id: https://code.elgg.org/elgg/trunk@806 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/elgglib.php | 3 +++ engine/lib/filestore.php | 11 ++++++++--- views/default/pageshells/pageshell.php | 6 +++--- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 9c071f497..eb4cd97df 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -116,6 +116,9 @@ $vars['page_owner_user'] = $usercache[$vars['page_owner']]; } } + if (!isset($vars['js'])) { + $vars['js'] = ""; + } // If it's been requested, pass off to a template handler instead if ($bypass == false && isset($CONFIG->template_handler) && !empty($CONFIG->template_handler)) { 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)); diff --git a/views/default/pageshells/pageshell.php b/views/default/pageshells/pageshell.php index c1287a51e..8af62e50e 100644 --- a/views/default/pageshells/pageshell.php +++ b/views/default/pageshells/pageshell.php @@ -19,11 +19,11 @@ // Set title if (empty($vars['title'])) { - $title = $vars['sitename']; - } else if (empty($vars['sitename'])) { + $title = $vars['config']->sitename; + } else if (empty($vars['config']->sitename)) { $title = $vars['title']; } else { - $title = $vars['sitename'] . ": " . $vars['title']; + $title = $vars['config']->sitename . ": " . $vars['title']; } ?> -- cgit v1.2.3