ckfinder 2.4.1
ckeditor 4.3.2
PHP 5.4.25
Problem:In the following code sample $page_edit_row["content"] may have <script></script> code within it. So the closing </script> is breaking the rest of the code.
<textarea cols="80" id="content" name="content" rows="10"></textarea>
<script type="text/javascript">
if ( typeof CKEDITOR == 'undefined' )
{
document.write(
'<strong><span style="color: #ff0000">Error</span>: CKEditor not found</strong>.' +
'This sample assumes that CKEditor (not included with CKFinder) is installed in' +
'the "/ckeditor/" path. If you have it installed in a different place, just edit' +
'this file, changing the wrong paths in the <head> (line 5) and the "BasePath"' +
'value (line 32).' ) ;
}
else
{
var editor = CKEDITOR.replace( 'content' );
editor.setData( '<?php echo str_replace("\r","",str_replace("\n","",addslashes(stripslashes($page_edit_row["content"])))); ?>' );
CKFinder.setupCKEditor( editor, 'ckfinder/' ) ;
}
</script>
Before we update to these version this is the code we used and it worked fine even with embeaded <script></script> code:
<?php
$ckeditor = new CKEditor() ;
$ckeditor->basePath = '/my-admin/ckeditor/' ;
CKFinder::SetupCKEditor( $ckeditor, '/my-admin/ckfinder/' ) ;
$ckeditor->editor('content', stripslashes($page_edit_row["content"]));
?>
Is there an option to switch back to the simple PHP code or a fix for the javascript code that will allow embeded javascript?
