diff --git a/Sources/Db/APIs/MySQL.php b/Sources/Db/APIs/MySQL.php index 389b2c6027..24a7217d26 100644 --- a/Sources/Db/APIs/MySQL.php +++ b/Sources/Db/APIs/MySQL.php @@ -158,14 +158,9 @@ public function query(string $identifier, string $db_string, array $db_values = } } + // Inject the values passed to this function. if (empty($db_values['security_override']) && (!empty($db_values) || str_contains($db_string, '{db_prefix}'))) { - $this->temp_values = $db_values; - $this->temp_connection = $connection; - - // Inject the values passed to this function. - $db_string = preg_replace_callback('~{([a-z_]+)(?::([a-zA-Z0-9_-]+))?}~', [$this, 'replacement__callback'], $db_string); - - unset($this->temp_values, $this->temp_connection); + $db_string = $this->quote($db_string, $db_values, $connection); } // First, we clean strings out of the query, reduce whitespace, lowercase, and trim - so we can check it over. diff --git a/Sources/Db/APIs/PostgreSQL.php b/Sources/Db/APIs/PostgreSQL.php index 1aef375f1f..e6b6ddc596 100644 --- a/Sources/Db/APIs/PostgreSQL.php +++ b/Sources/Db/APIs/PostgreSQL.php @@ -208,14 +208,9 @@ public function query(string $identifier, string $db_string, array $db_values = } } + // Inject the values passed to this function. if (empty($db_values['security_override']) && (!empty($db_values) || str_contains($db_string, '{db_prefix}'))) { - $this->temp_values = $db_values; - $this->temp_connection = $connection; - - // Inject the values passed to this function. - $db_string = preg_replace_callback('~{([a-z_]+)(?::([a-zA-Z0-9_-]+))?}~', [$this, 'replacement__callback'], $db_string); - - unset($this->temp_values, $this->temp_connection); + $db_string = $this->quote($db_string, $db_values, $connection); } // First, we clean strings out of the query, reduce whitespace, lowercase, and trim - so we can check it over.