Skip to content

Commit e2d47db

Browse files
Transform sub/sub directories into a proper dbprefix
Enables a test case similar to the following: ``` Given a WP install in 'subdir1' And I run `mkdir -p sub/sub` And a WP install in 'sub/subdir2' And a WP install in 'sub/sub/subdir3' ```
1 parent ae32904 commit e2d47db

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

features/bootstrap/FeatureContext.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ public function download_wp( $subdir = '' ) {
318318

319319
public function create_config( $subdir = '' ) {
320320
$params = self::$db_settings;
321-
$params['dbprefix'] = $subdir ?: 'wp_';
321+
$params['dbprefix'] = $subdir ? preg_replace( '#[^a-zA-Z\_0-9]#', '_', $subdir ) : 'wp_';
322322

323323
$params['skip-salts'] = true;
324324
$this->proc( 'wp core config', $params, $subdir )->run_check();

0 commit comments

Comments
 (0)