Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#13364 closed Bug (expired)

CKEdit Stripping out Form tags?

Reported by: Michael Muller Owned by:
Priority: Normal Milestone:
Component: General Version: 4.4.4
Keywords: Cc: tech@…

Description

If I paste the HTML for a PayPal donate button form, for instance, CKEditor will strip out the form tag. And I know it's CK that's doing it because I can paste in the form HTML while in source mode, unclick source to wysiwyg more, then click back to source code, and the form tag is gone. I haven't posted it to the server. Simply clicked from source, to edit, and back to source. Gone.

If I paste the HTML in while in source mode and then click submit in my CMS without first going back to edit mode, the HTML code will go into the db with no troubles. It will render in the browser no problem when the page is loaded. If I click edit in the CMS and I'm back in CK in wysiwyg mode, I can click on source and can see that the form tag has stripped out.

I've gone into config.js and added config.allowedContent=true; but it doesn't seem to do anything.

What am I doing wrong?

Perhaps I should upgrade to 4.4.7 or higher?

Thanks.

Change History (11)

comment:1 Changed 3 years ago by Jakub Ś

Status: newpending
  1. Could you provide code that you are trying to paste? I will check it in default standalone CKEditor.
  2. Please upgrade to latest version - it is always best to have the latest version.
  3. Please make sure that browser and CMS cache have been cleared after you have added config.allowedContent=true; to config.js (just to make sure that old file version is not served).

comment:2 Changed 3 years ago by Piotrek Koszuliński

Resolution: expired
Status: pendingclosed

comment:3 Changed 3 years ago by Michael Muller

The code is simple PayPal button code.

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank"> <input type="hidden" name="cmd" value="_s-xclick"> ..... </form>

Just the form and /form tags are removed. Everything else stays. Here is my config.js file. I am running 4.5.2 now.

CKEDITOR.editorConfig = function( config ) {

config.toolbarGroups = [

{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] }, { name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] }, { name: 'links' }, { name: 'insert' }, { name: 'forms' }, { name: 'tools' }, { name: 'document', groups: [ 'mode', 'document', 'doctools' ] }, { name: 'others' }, '/', { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] }, { name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] }, { name: 'styles' }, { name: 'colors' }, { name: 'about' }

];

config.removeButtons = 'Underline,Subscript,Superscript';

config.format_tags = 'p;h1;h2;h3;h4;pre;div';

config.allowedContent = true;

config.baseHref = '/';

config.bodyClass = 'page';

};

comment:4 Changed 3 years ago by Michael Muller

Cc: tech@… added

comment:5 Changed 3 years ago by Piotrek Koszuliński

I tested the HTML that you pasted in a sample with the ACF disabled, and nothing has been filtered out. The same if I remove the whole forms plugin. So please make a sample (e.g. on jsfiddle) that will show the issue.

comment:6 Changed 3 years ago by Michael Muller

I even tried putting var config.allowedContent=true; into a script tag on the page. No change.

Here's the builder file. I think it may be one of the plugins.

var CKBUILDER_CONFIG = {

skin: 'moono', preset: 'standard', ignore: [

'.bender', 'bender.js', 'bender-err.log', 'bender-out.log', 'dev', '.DS_Store', '.editorconfig', '.gitattributes', '.gitignore', 'gruntfile.js', '.idea', '.jscsrc', '.jshintignore', '.jshintrc', 'less', '.mailmap', 'node_modules', 'package.json', 'README.md', 'tests'

], plugins : {

'autogrow' : 1, 'basicstyles' : 1, 'blockquote' : 1, 'clipboard' : 1, 'colorbutton' : 1, 'contextmenu' : 1, 'divarea' : 1, 'enterkey' : 1, 'entities' : 1, 'filebrowser' : 1, 'floatingspace' : 1, 'format' : 1, 'horizontalrule' : 1, 'htmlwriter' : 1, 'image' : 1, 'indentlist' : 1, 'justify' : 1, 'link' : 1, 'list' : 1, 'magicline' : 1, 'maximize' : 1, 'pastefromword' : 1, 'pastetext' : 1, 'removeformat' : 1, 'scayt' : 1, 'showborders' : 1, 'sourcearea' : 1, 'specialchar' : 1, 'stylescombo' : 1, 'tab' : 1, 'table' : 1, 'tabletools' : 1, 'toolbar' : 1, 'undo' : 1, 'wsc' : 1, 'wysiwygarea' : 1, 'youtube' : 1

}, languages : {

'en' : 1

}

};

comment:7 Changed 3 years ago by Michael Muller

No, that's not it.

var CKBUILDER_CONFIG = {

skin: 'moono', preset: 'standard', ignore: [

'.bender', 'bender.js', 'bender-err.log', 'bender-out.log', 'dev', '.DS_Store', '.editorconfig', '.gitattributes', '.gitignore', 'gruntfile.js', '.idea', '.jscsrc', '.jshintignore', '.jshintrc', 'less', '.mailmap', 'node_modules', 'package.json', 'README.md', 'tests'

], plugins : {

'autogrow' : 1, 'basicstyles' : 1, 'blockquote' : 1, 'clipboard' : 1, 'colorbutton' : 1, 'contextmenu' : 1, 'divarea' : 1, 'enterkey' : 1, 'filebrowser' : 1, 'floatingspace' : 1, 'format' : 1, 'horizontalrule' : 1, 'image' : 1, 'indentlist' : 1, 'justify' : 1, 'link' : 1, 'list' : 1, 'magicline' : 1, 'maximize' : 1, 'pastefromword' : 1, 'pastetext' : 1, 'removeformat' : 1, 'scayt' : 1, 'showborders' : 1, 'sourcearea' : 1, 'specialchar' : 1, 'stylescombo' : 1, 'tab' : 1, 'table' : 1, 'tabletools' : 1, 'toolbar' : 1, 'undo' : 1, 'wsc' : 1, 'wysiwygarea' : 1, 'youtube' : 1

}, languages : {

'en' : 1

}

};

comment:8 Changed 3 years ago by Michael Muller

Wait... ignore editorconfig?

comment:9 Changed 3 years ago by Piotrek Koszuliński

Wait... ignore editorconfig?

http://editorconfig.org/

That has nothing to do with CKEditor if that's what you meant.

comment:10 Changed 3 years ago by Jakub Ś

I have deliberately removed forms plugin and set allowedContent to true.

var editor = CKEDITOR.replace( 'editor1', {
	extraPlugins : 'embed,embedsemantic,autoembed,autolink',
	removePlugins : 'forms',
	allowedContent : true
});

No form tags were removed. There is something definitely wrong in your implementation.

If possible please start from scratch with default editor (best with 4.5.3) and no custom plugins. You can attach them later once you get default editor to work.

comment:11 Changed 3 years ago by Michael Muller

Ok. I'll try that.

Note: See TracTickets for help on using tickets.
© 2003 – 2017 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy