Use LIKE escaping from $wpdb

[MAILPOET-4055]
This commit is contained in:
Jan Jakes
2022-03-10 11:30:02 +01:00
committed by Veljko V
parent 686e046c40
commit efdca49f2e

View File

@@ -67,7 +67,7 @@ class Migrator {
} }
public function hasSchema(): bool { public function hasSchema(): bool {
$pattern = str_replace('_', '\\_', $this->prefix) . '%'; $pattern = $this->wpdb->esc_like($this->prefix) . '%';
return $this->runQuery("SHOW TABLES LIKE '$pattern'") > 0; return $this->runQuery("SHOW TABLES LIKE '$pattern'") > 0;
} }