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
- Forum
- JCE Editor
- Disable stripped code
Support is currently Online
Official support hours:
Monday To Friday
From 09:00 To 17:00 Europe/London (BST)
From 09:00 To 17:00 Europe/London (BST)
Hi. I am using sourcerer and want to write PHP code, but JCE is always stripping the "<?php" and "?>" opening and closing tags for: "<span data-mce-type="php" class="mcePhp"><!--" and "--></span>", respectively.
For example, I write:
JCE changes to:
And this makes the code not work at all.
I want to disable that code changing that JCE does. How can I make it?
Thanks.
For example, I write:
{source}<?php echo "name"; ?>{/source}
JCE changes to:
{source}<span data-mce-type="php" class="mcePhp"><!-- echo "name"; --></span>{/source}
And this makes the code not work at all.
I want to disable that code changing that JCE does. How can I make it?
Thanks.
It seems to have something to do with the way Sourcerer inserts the code, because if you click the [Toggle Editor] link above the editor toolbar, then paste in the code:
{source}<?php echo "name"; ?>{/source}
Then click [Toggle Editor] again, the code is retained.
{source}<?php echo "name"; ?>{/source}
Then click [Toggle Editor] again, the code is retained.
Just because you're not paranoid doesn't mean everybody isn't out to get you.
Hmmm, it isn´t the way that occurs with me... In fact, doesn´t matter if I write the code in or out of JCE. In the two cases when I toggle the editor, JCE rewrite the code. If your JCE doesn´t do that, so send it to me, because we are using different versions! hehe
By the way, the problem isn´t in the sourcerer, because even without sourcerer tags the JCE also rewrite the code.
The only thing I want is a "leave all that code alone mode" in JCE. This isn´t possible?
By the way, the problem isn´t in the sourcerer, because even without sourcerer tags the JCE also rewrite the code.
The only thing I want is a "leave all that code alone mode" in JCE. This isn´t possible?
The only thing I want is a "leave all that code alone mode" in JCE. This isn´t possible?
JCE is primarily an HTML editor, and PHP code is not HTML, so it has to be converted and protected so it is not processed as HTML, hence the <span data-mce-type="php" tags.
Hmmm, it isn´t the way that occurs with me... In fact, doesn´t matter if I write the code in or out of JCE. In the two cases when I toggle the editor, JCE rewrite the code. If your JCE doesn´t do that, so send it to me, because we are using different versions!
Please send me a login - https://www.joomlacontenteditor.net/contact/site-login
Just because you're not paranoid doesn't mean everybody isn't out to get you.
I agree in some extent that JCE is primary a HTML editor and PHP is not HTML. But, we cannot deny that not all users will be satisfyed only with HTML. For the newbie user this could be true, but for some average users write some simple PHP and JS with HTML can be handy. This is so true that JCE already have an option to enable PHP and JS.
The "leave all that code alone mode" was a joke. I know that such a simplistic option cannot be the best and more secure solution. But, the frustration persists when I think that I need to search deep into all of that options in the configuration, and think that "Allow PHP" is there and set to "YES" but what I´m doing wrong because it doesn´t works at all.
Searching foward into this forum I realize that my request isn´t new. Several other people faces some difficulties when inserting code, even HTML, in JCE through the years. I know that is complex to do an option that could impact in the security of the site. But, the fact is that JCE´s php rewrite sometimes doesn´t works as it should. I don´t know why, because all looks correctly configured. Could be interesting to investigate this, because JCE is a wonderful tool and it would be fantastic if we can use it with PHP code without any other palliative solutions like Sourcerer.
Thank you for all your help! I will send you the login.
The "leave all that code alone mode" was a joke. I know that such a simplistic option cannot be the best and more secure solution. But, the frustration persists when I think that I need to search deep into all of that options in the configuration, and think that "Allow PHP" is there and set to "YES" but what I´m doing wrong because it doesn´t works at all.
Searching foward into this forum I realize that my request isn´t new. Several other people faces some difficulties when inserting code, even HTML, in JCE through the years. I know that is complex to do an option that could impact in the security of the site. But, the fact is that JCE´s php rewrite sometimes doesn´t works as it should. I don´t know why, because all looks correctly configured. Could be interesting to investigate this, because JCE is a wonderful tool and it would be fantastic if we can use it with PHP code without any other palliative solutions like Sourcerer.
Thank you for all your help! I will send you the login.
I've just tested this on your site now and it is working fine. I think the original problem may have been caused by you putting "span" as a prohibited element in Editor Profiles -> Editor Parameters -> Advanced.
This is not possible because Joomla cannot execute PHP code written in articles. Sourcerer performs additional processing of article content prior to display to execute the code.
it would be fantastic if we can use it with PHP code without any other palliative solutions like Sourcerer.
This is not possible because Joomla cannot execute PHP code written in articles. Sourcerer performs additional processing of article content prior to display to execute the code.
Just because you're not paranoid doesn't mean everybody isn't out to get you.
I faced the same problem.
The following code:
{source}
<?php
echo "Hello";
?>
{/source}
after saving while in Code mode becomes:
{source} <span class="mcePhp" data-mce-type="php"><!--
echo "Hello";
--> </span> {/source}
which produces no result when viewing the website.
Switching to the Editor mode and then back to the Code mode fixes the code on the screen.
Also only when saving while in the Editor mode is the code saved correctly and a result is seen when viewing the website.
The above problem appears only on versions 2.6.21 and afterwards.
I solved the problem by uninstalling JCE Pro and installing an older version (2.6.20) which works as expected.
By the way, trying to downgrade by installing version 2.6.20 while the 2.6.23 is installed does not solve the problem. JCE Pro has to be completely uninstalled before installing the JCE version 2.6.20.
Are we going to have a new version which will not present this glitch?
The following code:
{source}
<?php
echo "Hello";
?>
{/source}
after saving while in Code mode becomes:
{source} <span class="mcePhp" data-mce-type="php"><!--
echo "Hello";
--> </span> {/source}
which produces no result when viewing the website.
Switching to the Editor mode and then back to the Code mode fixes the code on the screen.
Also only when saving while in the Editor mode is the code saved correctly and a result is seen when viewing the website.
The above problem appears only on versions 2.6.21 and afterwards.
I solved the problem by uninstalling JCE Pro and installing an older version (2.6.20) which works as expected.
By the way, trying to downgrade by installing version 2.6.20 while the 2.6.23 is installed does not solve the problem. JCE Pro has to be completely uninstalled before installing the JCE version 2.6.20.
Are we going to have a new version which will not present this glitch?
@stavros - Please upgrade to JCE Pro 2.6.23, then in Editor Profiles -> Plugin Parameters -> Source Code Tab, set Validate Content to No.
I am working on a fix for this so that it will work with Validate Content = Yes.
I am working on a fix for this so that it will work with Validate Content = Yes.
Just because you're not paranoid doesn't mean everybody isn't out to get you.
- Page :
- 1
There are no replies made for this post yet.
Be one of the first to reply to this post!
Be one of the first to reply to this post!