deny the usage of dots in database name

This commit is contained in:
Georg Ehrke 2012-10-28 14:11:41 +01:00
parent b8a48b55a3
commit d7a6b09406
2 changed files with 4 additions and 1 deletions

View File

@ -111,7 +111,7 @@
</p> </p>
<p class="infield"> <p class="infield">
<label for="dbname" class="infield"><?php echo $l->t( 'Database name' ); ?></label> <label for="dbname" class="infield"><?php echo $l->t( 'Database name' ); ?></label>
<input type="text" name="dbname" id="dbname" value="<?php print OC_Helper::init_var('dbname'); ?>" autocomplete="off" /> <input type="text" name="dbname" id="dbname" value="<?php print OC_Helper::init_var('dbname'); ?>" autocomplete="off" pattern="[0-9a-zA-Z$_]+" />
</p> </p>
</div> </div>
<?php endif; ?> <?php endif; ?>

View File

@ -70,6 +70,9 @@ class OC_Setup {
if(empty($options['dbname'])) { if(empty($options['dbname'])) {
$error[] = "$dbprettyname enter the database name."; $error[] = "$dbprettyname enter the database name.";
} }
if(substr_count($options['dbname'], '.') >= 1){
$error[] = "$dbprettyname you may not use dots in the database name";
}
if($dbtype != 'oci' && empty($options['dbhost'])) { if($dbtype != 'oci' && empty($options['dbhost'])) {
$error[] = "$dbprettyname set the database host."; $error[] = "$dbprettyname set the database host.";
} }