Opened 10 years ago

Closed 10 years ago

#11250 closed Bug (fixed)

Quotes don't get converted to HTML entities inside <textarea>

Reported by: sir qwerty Owned by: Marek Lewandowski
Priority: Normal Milestone: CKEditor 4.3.1
Component: Core : Output Data Version: 4.3
Keywords: Cc:

Description

Quotes (both single and double) get converted to HTML entities correctly when typed inside block elements such as DIV, P, BLOCKQUOTE, CODE and so on.
<p>'a'<p> is converted to <p>&#39;a&#39;</p>

Unfortunatelly they are ignored when typed inside TEXTAREA element:
<p><textarea>'a'</textarea></p> stays untouched. Obviously this breaks up my later executed SQL statements. Ampersands get converted OK.

Securing the quotes during PHP process would be a workaround, but till now I've always relied on this CKeditor's function.

ACF is turned off (config.allowedContent = true;) everything else regarding entities is set to default values. Worked fine in V4, maybe got broken with deeper ACF implementation.

Windows browsers: IE 11, Chrome 31, FF 25.

Change History (8)

comment:1 Changed 10 years ago by Jakub Ś

Keywords: quotes entities textarea removed
Status: newconfirmed

I was able to reproduce this from CKEditor 4.3 in every browser.

comment:2 Changed 10 years ago by Marek Lewandowski

Owner: set to Marek Lewandowski
Status: confirmedassigned

comment:3 Changed 10 years ago by Marek Lewandowski

Status: assignedreview

Pushed to t/11250 at dev and tests.

I was thinking about adding tests for these entities to test process textarea in htmldataprocessor.html

with following code:

assert.areSame( os + '&quot;' + oe, toHtml( ss + '"' + se ), 'textarea processing did not convert double quote to entity' );
assert.areSame( ss + '&apos;' + se, toHtml( ss + '\'' + se ), 'textarea processing did not convert single quote to entity' );

But function toHtml() seems not to use all the goodies which editor#setData does. I ended up with adding them to separate TCs.

comment:4 Changed 10 years ago by Marek Lewandowski

Milestone: CKEditor 4.3.1

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

Status: reviewreview_failed

Test should be added to dt/plugins/entities, since they test that plugin.

comment:6 Changed 10 years ago by Marek Lewandowski

Status: review_failedreview

TCs moved.

comment:7 Changed 10 years ago by Piotrek Koszuliński

Status: reviewreview_passed

Pushed one additional commit to tests.

comment:8 Changed 10 years ago by Piotrek Koszuliński

Resolution: fixed
Status: review_passedclosed

Fixed on master with git:213d91c on dev and de69747 on tests.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy