EnlighterJS / Plugin.WordPress

:package: Official WordPress Plugin of EnlighterJS
http://wordpress.org/plugins/enlighter/
GNU General Public License v2.0
115 stars 17 forks source link

Offset issue with Crayon compatibility #278

Closed mrtnm closed 4 years ago

mrtnm commented 4 years ago

Apparently pretty recent, an error popped up in Crayon.php

Notice: Undefined offset: 1 in /var/www/yoursite/wp-content/plugins/enlighter/modules/compatibility/Crayon.php on line 44

it happens i.a. on https://techforce1.nl/hardware-to-secure-your-digital-identity/

PHP Version: 7.2.31-1+ubuntu18.04.1+deb.sury.org+1
PHP JSON Extension: available
Server Software: Linux

Components
Enlighter Plugin: 4.2 CE
EnlighterJS Version: 3.3.0
TinyMCE Extension: 5.0.1
Gutenberg Extension: 1.0.0
Theme Customizer: 2.2.0
WP-Skeleton Version: 0.23.0
AndiDittrich commented 4 years ago

Hi @mrtnm

thanks for that hint: it's caused by a crayon option attribute without a value - this should be fixed within your post/page.

additionally i can add a check which throws invalid attributes away.

AndiDittrich commented 4 years ago

6c2c2b8 addresses the issue and ignores all invalid attributes

mrtnm commented 4 years ago

Hi @mrtnm

thanks for that hint: it's caused by a crayon option attribute without a value - this should be fixed within your post/page.

additionally i can add a check which throws invalid attributes away.

mrtnm commented 4 years ago

Oops. Did not mean to close it. Just wanted to put a thumb up

AndiDittrich commented 4 years ago

in case you can confirm that the missing value had caused the behaviour you can also close it

mrtnm commented 4 years ago

6c2c2b8 addresses the issue and ignores all invalid attributes

Though I am unable to check this on the clients site right now myself, I trust the above code completely as to be the solution (at least, to avoid the errors). So thanks again.