Skip to content

Commit de52bfc

Browse files
committed
Add check for empty table prefix
1 parent d4d505f commit de52bfc

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/Config_Command.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ public function create( $_, $assoc_args ) {
149149
'config-file' => rtrim( ABSPATH, '/\\' ) . '/wp-config.php',
150150
];
151151
$assoc_args = array_merge( $defaults, $assoc_args );
152+
if ( empty( $assoc_args['dbprefix'] ) ) {
153+
WP_CLI::error( '--dbprefix cannot be empty' );
154+
}
152155
if ( preg_match( '|[^a-z0-9_]|i', $assoc_args['dbprefix'] ) ) {
153156
WP_CLI::error( '--dbprefix can only contain numbers, letters, and underscores.' );
154157
}

0 commit comments

Comments
 (0)