Opened 10 years ago

Closed 10 years ago

#12411 closed Bug (fixed)

Missing null check in the pagebreak plugin

Reported by: (David *)Frenkiel Owned by: Artur Delura
Priority: Normal Milestone: CKEditor 4.4.5
Component: Core : Parser Version: 4.1
Keywords: Cc:

Description

Line 137 in plugins/pagebreak/plugin.js: <code>return parent && parent.name == 'div' && parent.styles[ 'page-break-after' ]; </code>

I've come across content in which parent.styles was undefined, resulting in the parser process crashing and further plugins not being loaded. I'll try to add a screenshot, if the system here permits it.

Attachments (1)

ttt.png (103.5 KB) - added by (David *)Frenkiel 10 years ago.
Screenshot from devtools

Download all attachments as: .zip

Change History (7)

Changed 10 years ago by (David *)Frenkiel

Attachment: ttt.png added

Screenshot from devtools

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

Keywords: pagebreak removed
Status: newpending

The styles property should not be null during data filtering. So the bug is somewhere in ACF or in the way how it's used. Could you provide more details (a working sample preferably) which will let us reproduce this error?

comment:2 Changed 10 years ago by (David *)Frenkiel

sure, try here: http://www.loopindex.com/lite/spanbug/?v=dev

open in chrome.

  1. wait for the page to load.
  2. open dev tools
  3. type the letter 'a' before the word 'delete'. It should have a light blue bg.
  4. switch to source mode
  5. switch to wysiwyg mode
  6. boom

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

Milestone: CKEditor 4.4.5
Status: pendingconfirmed
Version: 4.1

OK, I understood the issue. You have spans directly in the editable because auto paragraphing is disabled. We access span.parent which gives us a the editable, but since this element is not passed through filter it does not have the style property. You're right that check must be added.

comment:4 Changed 10 years ago by Artur Delura

Owner: set to Artur Delura
Status: confirmedassigned

comment:5 Changed 10 years ago by Artur Delura

Status: assignedreview

Changes and tests in branch:t/12411.

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

Resolution: fixed
Status: reviewclosed

Perfect. Fixed on master with git:6daae25.

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