Skip to content

Commit

Permalink
Cast the converter condition to bool
Browse files Browse the repository at this point in the history
  • Loading branch information
guvra committed Mar 9, 2020
1 parent 18efc12 commit 6a49c53
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Converter/Proxy/Conditional.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function __construct(array $parameters)
*/
public function convert($value, array $context = [])
{
$result = eval($this->condition);
$result = (bool) eval($this->condition);

if ($result) {
if ($this->ifTrueConverter) {
Expand Down
2 changes: 1 addition & 1 deletion src/Dumper/Mysqldump/DataConverterExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ private function getHook(): callable

// Evaluate the skip condition
if (isset($this->skipConditions[$table])) {
$this->skipRowConversion = eval($this->skipConditions[$table]);
$this->skipRowConversion = (bool) eval($this->skipConditions[$table]);
}
}

Expand Down

0 comments on commit 6a49c53

Please sign in to comment.