Skip to content

Commit

Permalink
Merge pull request #2 from martingtheodo/fix/postgres-connection
Browse files Browse the repository at this point in the history
fix(database-activator): paramametrize sql query to avoid postgres error
  • Loading branch information
migo315 authored May 27, 2021
2 parents e152fad + a4924d1 commit d7e13f4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Activator/DatabaseActivator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d7e13f4

Please sign in to comment.