Skip to content

Commit

Permalink
Merge pull request #103 from baddiedev/master
Browse files Browse the repository at this point in the history
Fix "Generate New DB Table Prefix" bug
  • Loading branch information
Arsenal21 authored Sep 20, 2020
2 parents 8f98308 + 69ade75 commit 50322eb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion all-in-one-wp-security/admin/wp-security-database-menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,9 @@ function change_db_prefix($table_old_prefix, $table_new_prefix)
foreach ($config_contents as $line_num => $line) {
$no_ws_line = preg_replace( '/\s+/', '', $line ); //Strip white spaces
if(strpos($no_ws_line, $prefix_match_string) !== FALSE){
$config_contents[$line_num] = str_replace($table_old_prefix, $table_new_prefix, $line);
$prefix_parts = explode("=",$config_contents[$line_num]);
$prefix_parts[1] = str_replace($table_old_prefix, $table_new_prefix, $prefix_parts[1]);
$config_contents[$line_num] = implode("=",$prefix_parts);
break;
}
}
Expand Down

0 comments on commit 50322eb

Please sign in to comment.