crayon-syntax-highlighter icon indicating copy to clipboard operation
crayon-syntax-highlighter copied to clipboard

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

Open portalzine opened this issue 6 years ago • 3 comments

crayon_langs.class.php Line 340:

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

Regards Alex

portalzine avatar Feb 04 '19 14:02 portalzine

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

0x501D avatar Feb 04 '19 15:02 0x501D

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 avatar May 12 '20 19:05 aadler

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

aadler avatar May 13 '20 16:05 aadler