Jump to content

Bug Report: HTML code can break CKEditor due to an IPS specific JS function


Recommended Posts

Well it's rather simple: 

Insert the following HTML code into the source code view of the WYSIWYG editor and you will breakt it:

<blockquote class="ipsQuote">Hello there!</blockquote>

This will throw the following JS error:

Uncaught TypeError: b.children[0].hasClass is not a function
    at a.upcast (plugin.js?t=M38E:2:54)
    at Array.<anonymous> (ckeditor.js?v=3467ab98ca1654518773:29:457)
    at iterator (ckeditor.js?v=3467ab98ca1654518773:978:440)
    at window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.htmlParser.element.forEach (ckeditor.js?v=3467ab98ca1654518773:302:462)
    at window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.htmlParser.element.forEach (ckeditor.js?v=3467ab98ca1654518773:303:57)
    at b.<anonymous> (ckeditor.js?v=3467ab98ca1654518773:993:47)
    at b.e (ckeditor.js?v=3467ab98ca1654518773:10:246)
    at b.<anonymous> (ckeditor.js?v=3467ab98ca1654518773:12:91)
    at window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.editor.CKEDITOR.editor.fire (ckeditor.js?v=3467ab98ca1654518773:13:285)
    at CKEDITOR.htmlDataProcessor.toHtml (ckeditor.js?v=3467ab98ca1654518773:323:170)
upcast @ plugin.js?t=M38E:2
(anonymous) @ ckeditor.js?v=3467ab98ca1654518773:29
iterator @ ckeditor.js?v=3467ab98ca1654518773:978
forEach @ ckeditor.js?v=3467ab98ca1654518773:302
forEach @ ckeditor.js?v=3467ab98ca1654518773:303
(anonymous) @ ckeditor.js?v=3467ab98ca1654518773:993
e @ ckeditor.js?v=3467ab98ca1654518773:10
(anonymous) @ ckeditor.js?v=3467ab98ca1654518773:12
window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.editor.CKEDITOR.editor.fire @ ckeditor.js?v=3467ab98ca1654518773:13
toHtml @ ckeditor.js?v=3467ab98ca1654518773:323
setData @ ckeditor.js?v=3467ab98ca1654518773:368
(anonymous) @ ckeditor.js?v=3467ab98ca1654518773:375
e @ ckeditor.js?v=3467ab98ca1654518773:10
(anonymous) @ ckeditor.js?v=3467ab98ca1654518773:12
window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.editor.CKEDITOR.editor.fire @ ckeditor.js?v=3467ab98ca1654518773:13
setData @ ckeditor.js?v=3467ab98ca1654518773:276
(anonymous) @ ckeditor.js?v=3467ab98ca1654518773:809
CKEDITOR.editor.setMode @ ckeditor.js?v=3467ab98ca1654518773:353
exec @ ckeditor.js?v=3467ab98ca1654518773:925
exec @ ckeditor.js?v=3467ab98ca1654518773:205
execCommand @ ckeditor.js?v=3467ab98ca1654518773:274
CKEDITOR.tools.extend.click @ ckeditor.js?v=3467ab98ca1654518773:678
execute @ ckeditor.js?v=3467ab98ca1654518773:679
(anonymous) @ ckeditor.js?v=3467ab98ca1654518773:680
(anonymous) @ ckeditor.js?v=3467ab98ca1654518773:31
callFunction @ ckeditor.js?v=3467ab98ca1654518773:31
onclick @ ?do=edit&d=6&id=13842&csrfKey=e5a0e93d973b6315bd8617bc97e651cf:1

Bascially, if a <blockquote >with the class "ipsQuote" does NOT start with an an html element like <p>, <div>, <span> etc. the editor will break. 

This works (despite <xzy> is NOT a valid html tag):

<blockquote class="ipsQuote"><xyz>Hello there!</xyz></blockquote>

this kills the editor:

<blockquote class="ipsQuote">Hello there!</blockquote>

Could contain: Face, Person, Human

Link to comment
Share on other sites

  • 1 year later...

From time to time I see this error in the console.

Uncaught TypeError: Cannot read properties of null (reading 'getElementsByTag')
    at $.setState (ckeditor.js?v=75e091aa041689860322:858:110)
    at $.g (ckeditor.js?v=75e091aa041689860322:852:133)
    at b.f (ckeditor.js?v=75e091aa041689860322:10:246)
    at b.<anonymous> (ckeditor.js?v=75e091aa041689860322:12:91)
    at window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.editor.CKEDITOR.editor.fire (ckeditor.js?v=75e091aa041689860322:13:285)
    at ckeditor.js?v=75e091aa041689860322:355:85

Zrzutekranu2023-07-20154725.png.c73ad3ee0ce448f9c25d548fa939afab.png

Link to comment
Share on other sites

25 minutes ago, SeNioR- said:

From time to time I see this error in the console.

Uncaught TypeError: Cannot read properties of null (reading 'getElementsByTag')
    at $.setState (ckeditor.js?v=75e091aa041689860322:858:110)
    at $.g (ckeditor.js?v=75e091aa041689860322:852:133)
    at b.f (ckeditor.js?v=75e091aa041689860322:10:246)
    at b.<anonymous> (ckeditor.js?v=75e091aa041689860322:12:91)
    at window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.editor.CKEDITOR.editor.fire (ckeditor.js?v=75e091aa041689860322:13:285)
    at ckeditor.js?v=75e091aa041689860322:355:85

Zrzutekranu2023-07-20154725.png.c73ad3ee0ce448f9c25d548fa939afab.png

It might be related to https://github.com/ckeditor/ckeditor4/issues/5369 but it's pretty safe to say this won't be fixed. CKEditor 4 isn't going to receive any further updates.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...