aramk / crayon-syntax-highlighter

Syntax Highlighter supporting multiple languages, themes, fonts, highlighting from a URL, local file or post text.
https://wordpress.org/plugins/crayon-syntax-highlighter/
GNU General Public License v3.0
1.1k stars 248 forks source link

Uncaught Error: Call to a member function id() #475

Open gpahlevanzadeh opened 4 years ago

gpahlevanzadeh commented 4 years ago

I setup a new httpd server and run my wordpress, I use crayon-syntax-highlighter plugin. And I get the following log in httpd.log:

[Mon May 11 08:35:02.022663 2020] [php7:error] [pid 82334] [client 88.198.44.37:39298] PHP Fatal error: Uncaught Error: Call to a member function id() on array in /usr/local/www/apache24/data/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php:36\nStack trace:\n#0 /usr/local/www/apache24/data/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php(538): CrayonFormatter::format_code()\n#1 [internal function]: CrayonFormatter::delim_to_internal()\n#2 /usr/local/www/apache24/data/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php(516): preg_replace_callback()\n#3 /usr/local/www/apache24/data/wp-content/plugins/crayon-syntax-highlighter/crayon_highlighter.class.php(166): CrayonFormatter::format_mixed_code()\n#4 /usr/local/www/apache24/data/wp-content/plugins/crayon-syntax-highlighter/crayon_highlighter.class.php(186): CrayonHighlighter->process()\n#5 /usr/local/www/apache24/data/wp-content/plugins/crayon-syntax-highlighter/crayon_wp.class.php(703): CrayonHighlighter->output()\n#6 /usr/local/www/apache24/data/wp-includes/class-wp-hook.php(287): CrayonWP::the_content() in /usr/local/www/apache24/data/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 36

How can I solve it?

worldsdream commented 4 years ago

Please use the following plugin. It’s a fork of crayon syntax highligther.

I have been using it for a while and I don’t have issues.

If you do have problems, let the developer know on the support page of the plugin.

https://wordpress.org/plugins/urvanov-syntax-highlighter/