Fixed Tip text with eval=yes cannot contain percent sign ("%")

jcc

Member
J!4, Fabrik 4 initial release kit.

Element tip text that includes a '%' character anywhere when Eval=Yes results in an exception when trying to view the list or form:

3 arguments are required, 2 given

Percent sign can be anywhere in the tip text, including in a comment.

e.g.

return '99.99%';

stack trace reports in components\com_fabrik\models\element.php at line 2019:

FabrikWorker::logEval($res, 'Caught exception (%s) on eval of ' . $this->getElement()->name . ' tip: ' . $tip);

Replacing the '%' in $res and $tip with '%' corrects the issue:

FabrikWorker::logEval(str_replace('%','%',$res), 'Caught exception (%s) on eval of ' . $this->getElement()->name . ' tip: ' . str_replace('%','%',$tip));
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top