diff --git a/mailpoet/lib/Automation/Engine/Migrations/Migrator.php b/mailpoet/lib/Automation/Engine/Migrations/Migrator.php index 988fa8b4d3..ff95412fb8 100644 --- a/mailpoet/lib/Automation/Engine/Migrations/Migrator.php +++ b/mailpoet/lib/Automation/Engine/Migrations/Migrator.php @@ -67,7 +67,7 @@ class Migrator { } public function hasSchema(): bool { - $pattern = str_replace('_', '\\_', $this->prefix) . '%'; + $pattern = $this->wpdb->esc_like($this->prefix) . '%'; return $this->runQuery("SHOW TABLES LIKE '$pattern'") > 0; }