Skip to content

Commit 8322e37

Browse files
prefix wp table with wp_ (hestiacp#4697)
* prefix wp table with wp_ resolves hestiacp#4696 --------- Co-authored-by: Jaap Marcus <9754650+jaapmarcus@users.noreply.github.com>
1 parent 0a3eeb8 commit 8322e37

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

web/src/app/WebApp/Installers/WordPress/WordPressSetup.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ public function install(array $options = null) {
7979
$result,
8080
);
8181
foreach ($result->raw as $line_num => $line) {
82-
if ('$table_prefix =' === substr($line, 0, 15)) {
83-
$result->raw[$line_num] =
84-
'$table_prefix = \'' .
85-
addcslashes(Util::generate_string(5, false) . "_", "\\'") .
86-
"';\r\n";
82+
if (str_starts_with($line, '$table_prefix =')) {
83+
$result->raw[$line_num] = sprintf(
84+
"\$table_prefix = %s;\r\n",
85+
var_export("wp_" . Util::generate_string(5, false) . "_", true),
86+
);
8787
continue;
8888
}
8989
if (!preg_match('/^define\(\s*\'([A-Z_]+)\',([ ]+)/', $line, $match)) {

0 commit comments

Comments
 (0)