diff --git a/composer.json b/composer.json index 986cf65..6ed30c1 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ } }, "require": { - "php": ">=5.4", + "php": ">=7.0", "doctrine/orm": "^2.5" }, "require-dev": { diff --git a/src/Calc/CalcValues.php b/src/Calc/CalcValues.php index 0b935ff..4c01881 100644 --- a/src/Calc/CalcValues.php +++ b/src/Calc/CalcValues.php @@ -83,8 +83,12 @@ class CalcValues $calcValueAccount1 = 0; $calcValueAccount2 = 0; - eval($this->engine->getParameters()); - eval($this->engine->getFormulas()); + try{ + @eval($this->engine->getParameters()); + @eval($this->engine->getFormulas()); + }catch (\Throwable $e) { + + } /** @var EdgeCollection $collection */ foreach ($container as $collection) { diff --git a/src/Calc/Formel.php b/src/Calc/Formel.php index f64448d..6fef875 100644 --- a/src/Calc/Formel.php +++ b/src/Calc/Formel.php @@ -82,8 +82,12 @@ class Formel preg_match_all('/\$P\w*\$P/', $formel, $founds); if (!empty($founds [0])) { - eval(str_replace('\\', '', $this->engine->getParameters())); + try{ + @eval($this->engine->getParameters()); + @eval($this->engine->getFormulas()); + }catch (\Throwable $e) { + } foreach ($founds [0] as $key => $found) { $foundvalue = str_replace('$P', '', $found); if (isset($$foundvalue)) { @@ -102,7 +106,12 @@ class Formel preg_match_all('/\$F\w*\$F/', $formel, $founds); if (!empty($founds [0])) { - eval(str_replace('\\', '', $this->engine->getFormulas())); + try{ + @eval($this->engine->getParameters()); + @eval($this->engine->getFormulas()); + }catch (\Throwable $e) { + + } foreach ($founds [0] as $key => $found) { $foundvalue = str_replace('$F', '', $found);