Hi,
thanks for your post, and sorry for the trouble.
TablePress does indeed use a formula evaluation library that uses the PHP eval()
function, but only after extensive sanitization and formula parsing.
Unfortunately, there’s no direct way to turn off the formula evaluation. If you really must, you could use a filter hook to override the loading of the PHP class. TablePress a custom class loader, see https://github.com/TobiasBg/TablePress/blob/master/classes/class-render.php#L147-L148 , which you could intercept via the filter hooks https://github.com/TobiasBg/TablePress/blob/master/classes/class-tablepress.php#L204 and https://github.com/TobiasBg/TablePress/blob/master/classes/class-tablepress.php#L178
You would have to replace that with a mock class that has a method https://github.com/TobiasBg/TablePress/blob/master/classes/class-evaluate.php#L70 and that returns the unmodified input data.
By the way, I’ll soon be replacing the formula evaluation library that TablePress uses with a new one in TablePress 2.0. The new one has more features and does not rely on eval()
. It would then be necessary to revert your customizations from above again, so that you can then again use formulas.
That said, I’m not sure that you really have to take action here right now. Just deactivate eval()
on the server, and in the event that you do get warnings or errors, educate users to not use formulas (if that’s an option).
Regards,
Tobias