Hi Thomas,
thanks for your post, and sorry for the trouble.
No, sorry, I don’t see chances for this. Not using eval() would either require writing a new PHP parser – in PHP – or doing security checks on that PHP code. That’s not going to happen 🙂
Also, I’d actually recommend not using the PHP in tables Extension (i.e. the approach in general). Instead, if one has to use PHP code in tables, it’s usually better to put that code into a small custom plugin that basically turns the PHP into your own custom Shortcode. Then, you could simply use that Shortcode in the table cells, where you have previously used PHP directly.
Regards,
Tobias
Hi Tobias,
thanks for getting back so quickly! As a non-PHP guy, I thought my idea would be easy-peasy to do but now I know better.
Would you mind explaining to me why it would be better to use one of those PHP execute plugins rather than your extension? On my site, I am not just the only admin but the only backend-user in general – so security with your extension should be no more of an issue than with said PHP execute plugins.
Thanks a lot
Thomas
Hi,
To clarify: I did not mean to use one of those PHP execute plugins! Those suffer from the same problems, of having to use eval()!
What I meant is to put your PHP code into your own small plugin, where you then define a Shortcode around it, which you insert into the table.
Of course, if you are the only admin/user on your site, the risk of evaluating PHP in tables is lower than as if there were other users as well. One drawback that remains is that a hacker who would get your password would also be able to use PHP directly (but he can also do that if the plugin or theme editors are usable on your site).
Regards,
Tobias
Hi Tobias,
oopps – seems like I didn’t read your post carefully enough…. The idea that these PHP execute plugins make use of eval() also, came to my mind when I tried some of these plugins today and one of them gave me an eval() related PHP error….
I have now settled for one of those PHP execute plugins (which works) because using tablepress + PHP extension + single cell content extension unfortunately would not.
Thanks for your advice in this issue!
Thomas
Hi,
no problem, you are very welcome! Good to hear that you found a solution!
Best wishes,
Tobias