From d9761880cba684017367b74a9244fcc4248254a9 Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Mon, 10 Dec 2018 03:34:57 +0800 Subject: [PATCH] Fix compatibility with PHP 7.3 The regex fails to parse in PHP 7.3, which broke the page in later functions. ``` PHP Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /var/www/felixcat/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340 ``` --- crayon_langs.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crayon_langs.class.php b/crayon_langs.class.php index 651f55c8..ade1811b 100644 --- a/crayon_langs.class.php +++ b/crayon_langs.class.php @@ -337,7 +337,7 @@ function __construct($id, $name = NULL) { // Override function clean_id($id) { $id = CrayonUtil::space_to_hyphen( strtolower(trim($id)) ); - return preg_replace('/[^\w-+#]/msi', '', $id); + return preg_replace('/[^\w\-+#]/msi', '', $id); } function ext($ext = NULL) { @@ -543,4 +543,4 @@ function path($path = NULL) { } } -?> \ No newline at end of file +?>