aboutsummaryrefslogtreecommitdiff
path: root/install/ElggInstaller.php
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2014-01-22 04:05:47 +0100
committerSem <sembrestels@riseup.net>2014-01-22 04:05:47 +0100
commit68614b769f4ae4f28c3f395f47b68baba7c48c64 (patch)
tree2c5a744a3859d27883f92b72aef9cf81f1a947d0 /install/ElggInstaller.php
parent69e2d8c5d8732042c9319aef1fdea45a82b63e42 (diff)
parentc0295c275d6edbca6c6c8bb51dc199150d0d5fc3 (diff)
downloadelgg-68614b769f4ae4f28c3f395f47b68baba7c48c64.tar.gz
elgg-68614b769f4ae4f28c3f395f47b68baba7c48c64.tar.bz2
Merge branch 'release/1.8.1'
Diffstat (limited to 'install/ElggInstaller.php')
-rw-r--r--install/ElggInstaller.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/install/ElggInstaller.php b/install/ElggInstaller.php
index 775bbf5b6..78cdde90f 100644
--- a/install/ElggInstaller.php
+++ b/install/ElggInstaller.php
@@ -1148,11 +1148,21 @@ class ElggInstaller {
foreach ($formVars as $field => $info) {
if ($info['required'] == TRUE && !$submissionVars[$field]) {
$name = elgg_echo("install:database:label:$field");
- register_error("$name is required");
+ register_error(elgg_echo('install:error:requiredfield', array($name)));
return FALSE;
}
}
+ // according to postgres documentation: SQL identifiers and key words must
+ // begin with a letter (a-z, but also letters with diacritical marks and
+ // non-Latin letters) or an underscore (_). Subsequent characters in an
+ // identifier or key word can be letters, underscores, digits (0-9), or dollar signs ($).
+ // Refs #4994
+ if (!preg_match("/^[a-zA-Z_][\w]*$/", $submissionVars['dbprefix'])) {
+ register_error(elgg_echo('install:error:database_prefix'));
+ return FALSE;
+ }
+
return $this->checkDatabaseSettings(
$submissionVars['dbuser'],
$submissionVars['dbpassword'],
@@ -1404,7 +1414,7 @@ class ElggInstaller {
$submissionVars['wwwroot'] = sanitise_filepath($submissionVars['wwwroot']);
$site = new ElggSite();
- $site->name = $submissionVars['sitename'];
+ $site->name = strip_tags($submissionVars['sitename']);
$site->url = $submissionVars['wwwroot'];
$site->access_id = ACCESS_PUBLIC;
$site->email = $submissionVars['siteemail'];