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)
Change History (7)
Changed 10 years ago by
comment:1 Changed 10 years ago by
Keywords: | pagebreak removed |
---|---|
Status: | new → pending |
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
sure, try here: http://www.loopindex.com/lite/spanbug/?v=dev
open in chrome.
- wait for the page to load.
- open dev tools
- type the letter 'a' before the word 'delete'. It should have a light blue bg.
- switch to source mode
- switch to wysiwyg mode
- boom
comment:3 Changed 10 years ago by
Milestone: | → CKEditor 4.4.5 |
---|---|
Status: | pending → confirmed |
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
Owner: | set to Artur Delura |
---|---|
Status: | confirmed → assigned |
comment:6 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | review → closed |
Perfect. Fixed on master with git:6daae25.
Screenshot from devtools