﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
10815	bug with extraAllowedContent and fakedObjects placeholders	jusca		"I was in hope my problem in 4.1.3 would have been gone with 4.2.1, but I have to admit it is still present.

What I do:
	include ckeditor with
    <script language=""javascript"" type=""text/javascript"" src=""/path/2/ckeditor.js""></script>

    set my own config:

    <script type=""text/javascript"">
        CKEDITOR.config['skin'] = 'moono';

        CKEDITOR.config['height'] = 400;

        CKEDITOR.config.allowedContent = <?php echo $acfoff; ?>;

        CKEDITOR.config.extraAllowedContent('mediainsert(*)[*]{*}; script(*)[*]{*}; php'); //works, see below but with error TypeError: CKEDITOR.config.extraAllowedContent is not a function and wrong toolbar, but not for <?php ?>

        [disabled] CKEDITOR.config.extraAllowedContent = 'mediainsert(*)[*]{*};script(*)[*]{*};php(*)[*]{*}'; // has now effect

        CKEDITOR.config.protectedSource.push(/<(script)[^>]*>.*<\/script>/ig); // javascript code, but seems already to be the kind of default in ckeditor.js (see below)

        [note] the <script> fakedObjects placeholder is shown, if commented out in ckeditor.js /<script[\s\S]*?<\/script>/gi

        CKEDITOR.config.protectedSource.push( /<\?[\s\S]*?\?>/g );   //PHP code

        CKEDITOR.config.protectedSource.push(/<mediainsert[\s\S\t\r\n]*?\/mediainsert>/img); // special CMS Plugin tag need to be untouched by ACF

        CKEDITOR.config.removeButtons = 'Styles';

        CKEDITOR.config.toolbarGroups = [ my special toolbar group settings ];
    </script>

Further on I have an included function file, to set the right instance and plugins for the two textares on my page.
There I do a:

        CKEDITOR.replace('nuggets' + item, {});

        CKEDITOR.config.extraPlugins = 'nuggets'+item +',mediaembed,pbckcode,script';

        CKEDITOR.plugins.add('nuggets' + item, { .... some plugin creations on the fly .... }); // they all work fine, except the 'script' plugin....

You can see the included 'script' plugin at last. This is mainly the same as addressed here http://jarrett.co/post/21454353089/creating-a-placeholder-for-in-ckeditor (even if I had to change the addCss command, since this threw an error).

Now, to my problems:
I want to allow javascript, php and special tags (eg. mediainsert) and have them untouched by ACF and replaced by a placeholder in wysiwyg-mode.

1. The enabled CKEDITOR.config.extraAllowedContent(...) line rules fires ""TypeError: CKEDITOR.config.extraAllowedContent is not a function"" and will stop executing my toolbarGroups, but enables the <mediainsert>...</mediainsert> placeholders.
2. The placeholder for script tags (javascript in textarea) does not happen, until I comment out the ""/<script[\s\S]*?<\/script>/gi"" in ckeditor.js (see disabled rule above).
3. Real <?php ?> tags do not work at all, but <php><?php echo 'hello world'; ?></php> does work from scratch without any changes.
4. The upper enabled CKEDITOR.config.protectedSource.push rules do their work successfully.
	
I tried everything I could imagine and could find in the docs, using different places or different kind of extraAllowedContent writings, but I can not get this to work!

CKEDITOR.config.extraAllowedContent seems not really to be read. Putting this into config.js file is the same.

Thanks for help and clarification!"	Bug	closed	Normal		General	4.2.1	invalid		
