Fabrik / fabrik

Fabrik for Joomla 3.x
http://fabrikar.com
Other
254 stars 380 forks source link

EVAL in PHP 7 ParseError #2086

Open enpepet opened 5 years ago

enpepet commented 5 years ago

We are migrating a fabrik App to Fabrik 3.9 and PHP 7. In previous versions of PHP/Fabrik the "Parse Error" does not stop the code and fabrik continues working logging the error unless debug is active.

NOW stops working If the syntax of PHP in the calc fields or events or dropdowns is not correct.

In PHP 7 maybe is needed to add a try / Catch in all "eval" calls and only trown an screen error on debug mode.

It is:

try { $res = eval($PHPcode); }catch(ParseError $e){ // LOG ERROR OR DIE }

Also maybe is better to centralize all calls to eval in a helper or class.