From a4924d179e3b5b75ae0ea4096e202382761402e6 Mon Sep 17 00:00:00 2001 From: Martin Guillier Date: Wed, 26 May 2021 18:53:27 +0200 Subject: [PATCH] fix(database-activator): paramametrize sql query to avoid postgres error --- src/Activator/DatabaseActivator.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Activator/DatabaseActivator.php b/src/Activator/DatabaseActivator.php index c4b1861..eb94be0 100644 --- a/src/Activator/DatabaseActivator.php +++ b/src/Activator/DatabaseActivator.php @@ -91,12 +91,12 @@ public function isActive($name, Context $context): bool // $result contains the response from state (true / false) or false if no feature found $result = $this->getConnection()->executeQuery( sprintf( - 'SELECT %s FROM %s WHERE %s = "%s"', + 'SELECT %s FROM %s WHERE %s = :feature_name', $this->options['db_column_state'], $this->options['db_table'], $this->options['db_column_feature'], - $name - ) + ), + ['feature_name' => $name] )->fetchOne(); return is_bool($result) ? $result : filter_var($result, FILTER_VALIDATE_BOOLEAN);