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

PHP 7.3 issue / fix: preg_replace(): Compilation failed: invalid range #456

Open portalzine opened 5 years ago

portalzine commented 5 years ago

crayon_langs.class.php Line 340:

return preg_replace('/[^\w-+#]/msi', '', $id); becomes return preg_replace('/[^\w-+#]/msi', '', $id);

Regards Alex

0x501D commented 5 years ago

PR will fix it: Fix compatibility with PHP 7.3 #451

aadler commented 4 years ago

I got the following just now too:

[12-May-2020 19:12:22 UTC] PHP Warning:  preg_replace(): Compilation failed: invalid range in character class at offset 4 in ***/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340
aadler commented 4 years ago

This project is defunct; switch to Urvanov Syntax Highlighter (Github here) which is Crayon brought up to date.