There's a bug somewhere but I'm not sure where this is happening... PHP code is deleted from the source.
Even worse, it seems it tries to auto-detect html encoded PHP tags.
Try this:
$f =& newFck('content');
$f->Value = $value;
Start off with $value as
The editor displays "This is a ."
OK, fair enough... maybe it sees it as an invalid HTML tag and deletes it.
Then try
This is perfect HTML and works as expected.
Next test:
This deletes the PHP and leaves an empty <pre> tag!
And finally, strangest of all....
This displays with the first block of PHP deleted:
But click on Source and back again, and the remaining PHP is deleted!
Even worse, it seems it tries to auto-detect html encoded PHP tags.
Try this:
$f =& newFck('content');
$f->Value = $value;
Start off with $value as
This is a <?php echo "test"; ?>.
The editor displays "This is a ."
OK, fair enough... maybe it sees it as an invalid HTML tag and deletes it.
Then try
This is a <?php echo "test"; ?>.
This is perfect HTML and works as expected.
Next test:
This is a <pre><?php echo "test"; ?></pre>.
This deletes the PHP and leaves an empty <pre> tag!
And finally, strangest of all....
<?php echo "hello"; ?> This is a <pre><?php echo "test"; ?></pre>.
This displays with the first block of PHP deleted:
This is a <?php echo "test"; ?> .
But click on Source and back again, and the remaining PHP is deleted!
This is a .
Re: Editor deletes PHP (even html encoded) - bug!
This was working fine before I upgraded to the latest version.
Re: Editor deletes PHP (even html encoded) - bug!
To avoid the first problem you should set enable in the config file the option to preserve php content.
The second issue about de-encoding the escaped content is a new bug, filed in http://dev.fckeditor.net/ticket/1414
Re: Editor deletes PHP (even html encoded) - bug!
Interestingly it seems to have fixed both the unescaping and the disappearing PHP blocks (unless that was fixed in a different bug).