You need to be logged in to post in the forum - Log In

An active JCE Pro Subscription is required to post in the forum - Buy a Subscription

Support is currently Online

Official support hours
Monday to Friday
09:00 - 17:00 Europe/London (BST)

#109304 JCE messes up php code

Posted in ‘Editor’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by ericwebsitebron on Wednesday, 17 November 2021 11:11 GMT

ericwebsitebron
Hi,

We have been using JCE editor with Sourcerer from Regular Labs for a long time, allowing to insert php code in articles with {source} tags.
Recently this stopped working, when saving the article the < and > from the php start and end are replaced with & l t ; and & g t ; and sometimes multiple statements are joined into one line.
Protect Shortcode is set to Yes.
Could you please check?
Thanks and best,
Eric

PS I tried to insert an example in a code block, but the Cloudflare filter blocked this!

Ryan
Please try JCE Pro 2.9.18 Beta 5 - https://www.joomlacontenteditor.net/downloads/editor/pro/development

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

ericwebsitebron
Hi Ryan,

This is better, but the editor still adds and strips stuff, see the screen shots before and after storing.
The "indents" are spaces, while the extra line breaks are gone.

Best,
Eric

Attachments

ericwebsitebron
By the way, same thing happens in RSRorm!Pro with the emails that it can send to a person that fills in the form and an admin.
Here too, the field labels and field values are entered between curly brackets.
A message that should be:

<p>Beste secretaris,</p>
<p>Het contactformulier is ingevuld met de volgende gegevens:</p>
<p>{Onderwerp:caption}: {Onderwerp:text}<br />
{aanhef:caption}: {aanhef:value}<br />
{Naam:caption}: {Naam:value}<br />
{Straat:caption}: {Straat:value}<br >
{Plaats:caption}: {Plaats:value}<br >
{Emailadres:caption}: {Emailadres:value}<br >
{Telefoon:caption}: {Telefoon:value}<br >
{Bericht:caption}:</p>
<p>{Bericht:value}</p>

ends up like this:

<p>Beste secretaris,</p>
<p>Het contactformulier is ingevuld met de volgende gegevens:</p>
<p>{Onderwerp:caption}: {Onderwerp:text} {aanhef:caption}: {aanhef:value} {Naam:caption}: {Naam:value} {Straat:caption}: {Straat:value} {Plaats:caption}: {Plaats:value} {Emailadres:caption}: {Emailadres:value} {Telefoon:caption}: {Telefoon:value} {Bericht:caption}:</p>
<p>{Bericht:value}</p>

Ryan
Please try JCE Pro 2.9.18 Beta 6 - https://www.joomlacontenteditor.net/downloads/editor/pro/development

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

ericwebsitebron
Hi Ryan,

I see no difference, still the same errors.

Best,
Eric

Ryan
By the way, same thing happens in RSRorm!Pro with the emails that it can send to a person that fills in the form and an admin. Here too, the field labels and field values are entered between curly brackets. A message that should be:

Beste secretaris,

Het contactformulier is ingevuld met de volgende gegevens:

{Onderwerp:caption}: {Onderwerp:text}
{aanhef:caption}: {aanhef:value}
{Naam:caption}: {Naam:value}
{Straat:caption}: {Straat:value}
{Plaats:caption}: {Plaats:value}
{Emailadres:caption}: {Emailadres:value}
{Telefoon:caption}: {Telefoon:value}
{Bericht:caption}:

{Bericht:value}

ends up like this:

Beste secretaris,

Het contactformulier is ingevuld met de volgende gegevens:

{Onderwerp:caption}: {Onderwerp:text} {aanhef:caption}: {aanhef:value} {Naam:caption}: {Naam:value} {Straat:caption}: {Straat:value} {Plaats:caption}: {Plaats:value} {Emailadres:caption}: {Emailadres:value} {Telefoon:caption}: {Telefoon:value} {Bericht:caption}:

{Bericht:value}

Please try JCE Pro 2.9.18 Beta 9 - https://www.joomlacontenteditor.net/downloads/editor/pro/development In Editor Profiles -> Editor Parameters -> Advanced, set Protect Shortcode to No. Although newlines will be removed (which is the correct behaviour), the linebreaks will not, so the code should still display as expected, eg:

<p>Beste secretaris,</p>
<p>Het contactformulier is ingevuld met de volgende gegevens:</p>
<p>{Onderwerp:caption}: {Onderwerp:text} {aanhef:caption}: {aanhef:value} {Naam:caption}: {Naam:value} {Straat:caption}: {Straat:value} {Plaats:caption}: {Plaats:value} {Emailadres:caption}: {Emailadres:value} {Telefoon:caption}: {Telefoon:value} {Bericht:caption}:</p>
<p>{Bericht:value}</p>

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

ericwebsitebron
Hi Ryan,

Yes, if I switch Protect shortcode off, it works with this version.
But I cannot do that, because that messes up my Articles Anywhere code, see this support ticket

Best,
Eric

Ryan
Yes, if I switch Protect shortcode off, it works with this version.
But I cannot do that, because that messes up my Articles Anywhere code, see this support ticket


Create a profile specifically for RSForms, with Protect Shortcode turned off.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

ericwebsitebron
Yes, that seems best of both worlds!
Thanks,
Eric