Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: txp PHP does not output
That was the easiest thing to do, I have not found a way to tell articles content from forms output after the first pass :-/
Offline
Re: txp PHP does not output
Thank you for all the assistance and input.
Good to know that <txp:php />
being disabled on the second pass has made txp safer. And the new <txp:evaluate />
is awesome!
• Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
• MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
• JapaneseStreets.com – Japanese street fashion (mostly txp)
Offline
Re: txp PHP does not output
etc wrote #319052:
Another point: if your code requires more complex calculations, you can register “safe” php functions for use in
<txp:evaluate />
via advanced prefs.
Could you explain how to register php functions in advanced prefs? (I can’t find this in the docs)
I do indeed have a site with complex calculations. I’m unable to determine a way that doesn’t involve a second pass to display some of our content.
Last edited by towndock (2019-10-09 16:56:08)
Offline
Re: txp PHP does not output
towndock wrote #319604:
Could you explain how to register php functions in advanced prefs? (I can’t find this in the docs)
I do indeed have a site with complex calculations. I’m unable to determine a way that doesn’t involve a second pass to display some of our content.
Sure, though this will only help with simple one-line calculations. Go to Preferences/Admin
pane, switch Advanced options
on and save. You will then gain access to Advanced options
pane, where you will find PHP functions enabled in txp:evaluate
pref. Its help is rather terse, so don’t hesitate to post your calculations here if needed.
Offline
Re: txp PHP does not output
Now <txp:php />
should work (almost) as before in dev branch, testers welcome. Article context is preserved on second+ passes, so users without php
rights should not be able to bypass this restriction any more.
An extra bonus is that (mistyped) things like
<txp:article_custom id="1,2,3" break=",">
<txp:variable name="id" value="<txp:article_id />" />
<txp:variable name="id" />
</txp:article_custom>
now work as expected, outputting 1,2,3
. You can try it in 4.7- to see the difference.
Offline
Re: txp PHP does not output
etc wrote #319641:
Now
<txp:php />
should work (almost) as before in dev branch, testers welcome. Article context is preserved on second+ passes, so users withoutphp
rights should not be able to bypass this restriction any more.
Now testing the 4.80 dev branch – all working fine with content that requires that second pass. Thank you much. Will be testing this version further.
Offline
Re: txp PHP does not output
towndock wrote #319710:
Now testing the 4.80 dev branch – all working fine with content that requires that second pass.
Nice to know it, thanks for testing. Sorry for the trouble it could have caused, but we patch all potential security holes asap, sometimes brutally.
Offline