From e7b2f4f1e68b1c3539f26fc917da04dc8f2a52cc Mon Sep 17 00:00:00 2001 From: cash Date: Mon, 30 Jan 2012 20:55:52 -0500 Subject: Refs #4324 installer checks for absolute path --- install/ElggInstaller.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'install/ElggInstaller.php') 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'])); -- cgit v1.2.3