aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2012-01-30 20:55:52 -0500
committercash <cash.costello@gmail.com>2012-01-30 20:55:52 -0500
commite7b2f4f1e68b1c3539f26fc917da04dc8f2a52cc (patch)
treefecc9d81812d70d6a63fd4ad46d9ce7fc7e042a8
parent2a581392174a61b930f8a3fd384454233f26939b (diff)
downloadelgg-e7b2f4f1e68b1c3539f26fc917da04dc8f2a52cc.tar.gz
elgg-e7b2f4f1e68b1c3539f26fc917da04dc8f2a52cc.tar.bz2
Refs #4324 installer checks for absolute path
-rw-r--r--install/ElggInstaller.php15
-rw-r--r--install/languages/en.php3
2 files changed, 17 insertions, 1 deletions
diff --git a/install/ElggInstaller.php b/install/ElggInstaller.php
index 94709ac4e..03c84a43e 100644
--- a/install/ElggInstaller.php
+++ b/install/ElggInstaller.php
@@ -1337,6 +1337,21 @@ class ElggInstaller {
}
}
+ // check that data root is absolute path
+ if (stripos(PHP_OS, 'win') === 0) {
+ if (strpos($submissionVars['dataroot'], ':') !== 1) {
+ $msg = elgg_echo('install:error:relative_path', array($submissionVars['dataroot']));
+ register_error($msg);
+ return FALSE;
+ }
+ } else {
+ if (strpos($submissionVars['dataroot'], '/') !== 0) {
+ $msg = elgg_echo('install:error:relative_path', array($submissionVars['dataroot']));
+ register_error($msg);
+ return FALSE;
+ }
+ }
+
// check that data root exists
if (!file_exists($submissionVars['dataroot'])) {
$msg = elgg_echo('install:error:datadirectoryexists', array($submissionVars['dataroot']));
diff --git a/install/languages/en.php b/install/languages/en.php
index c452fc793..3a692e020 100644
--- a/install/languages/en.php
+++ b/install/languages/en.php
@@ -88,7 +88,7 @@ If you are ready to proceed, click the Next button.",
'install:settings:help:siteemail' => 'Email address used by Elgg for communication with users',
'install:settings:help:wwwroot' => 'The address of the site (Elgg usually guesses this correctly)',
'install:settings:help:path' => 'The directory where you put the Elgg code (Elgg usually guesses this correctly)',
- 'install:settings:help:dataroot' => 'The directory that you created for Elgg to save files (the permissions on this directory are checked when you click Next)',
+ 'install:settings:help:dataroot' => 'The directory that you created for Elgg to save files (the permissions on this directory are checked when you click Next). It must be an absolute path.',
'install:settings:help:dataroot:apache' => 'You have the option of Elgg creating the data directory or entering the directory that you already created for storing user files (the permissions on this directory are checked when you click Next)',
'install:settings:help:language' => 'The default language for the site',
'install:settings:help:siteaccess' => 'The default access level for new user created content',
@@ -131,6 +131,7 @@ If you are ready to proceed, click the Next button.",
'install:error:readsettingsphp' => 'Unable to read engine/settings.example.php',
'install:error:writesettingphp' => 'Unable to write engine/settings.php',
'install:error:requiredfield' => '%s is required',
+ 'install:error:relative_path' => 'We don\'t think "%s" is an absoluate path for your data directory',
'install:error:datadirectoryexists' => 'Your data directory %s does not exist.',
'install:error:writedatadirectory' => 'Your data directory %s is not writable by the web server.',
'install:error:locationdatadirectory' => 'Your data directory %s must be outside of your install path for security.',