Skip to content

Commit eac0202

Browse files
author
Ivan Gavryshko
committed
MAGETWO-31904: There is no validation for 'Table prefix' on Step 2: Add a Database during instalation
- added format info to tooltip message - fixed validation according to format
1 parent 4f8800b commit eac0202

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

setup/src/Magento/Setup/Model/Installer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ public function checkDatabaseConnection($dbName, $dbHost, $dbUser, $dbPass = '')
766766
*/
767767
public function checkDatabaseTablePrefix($prefix)
768768
{
769-
if ($prefix !== '' && !preg_match('/^([[:alnum:]]+)([[:alnum:]_]+)$/', $prefix)) {
769+
if ($prefix !== '' && !preg_match('/^([a-zA-Z])([[:alnum:]]+)([[:alnum:]_]+)$/', $prefix)) {
770770
throw new \InvalidArgumentException('Please correct the table prefix format.');
771771
}
772772

setup/view/magento/setup/add-database.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@
149149
<label class="col-sm-4 control-label">Table prefix</label>
150150
<div class="col-sm-4">
151151
<input tooltip-placement="right"
152-
tooltip="Enter a tracking prefix to be used for database tables created for this Magento installation. (ex: 'mg1_' )"
152+
tooltip="Enter a tracking prefix to be used for database tables created for this Magento installation. (ex: 'mg1_' ). The table prefix should contain only letters (a-z), numbers (0-9) or underscores (_); the first character should be a letter."
153153
tooltip-trigger="focus"
154154
tooltip-append-to-body="true"
155155
class="form-control"

0 commit comments

Comments
 (0)