Properly support an empty escape in Highlighter.class.php
authorTim Düsterhus <duesterhus@woltlab.com>
Tue, 16 Dec 2014 22:52:54 +0000 (23:52 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 17 Dec 2014 17:57:40 +0000 (18:57 +0100)
wcfsetup/install/files/lib/system/bbcode/highlighter/Highlighter.class.php

index 64762f19117f3cdee0f08f06d829aa44d914ac78..fe0d2f055efa9b626670acd98895bae2e03bf6cd 100644 (file)
@@ -177,7 +177,13 @@ abstract class Highlighter extends SingletonFactory {
                        
                        $opening = preg_quote($opening);
                        $closing = preg_quote($closing);
-                       $quotesRegEx .= $opening.'(?>[^'.$closing.$quotedEscapeSequence.']|'.$quotedEscapeSequence.'.)*'.$closing;
+                       
+                       if ($quotedEscapeSequence) {
+                               $quotesRegEx .= $opening.'(?>[^'.$closing.$quotedEscapeSequence.']|'.$quotedEscapeSequence.'.)*'.$closing;
+                       }
+                       else {
+                               $quotesRegEx .= $opening.'(?>[^'.$closing.$quotedEscapeSequence.'])*'.$closing;
+                       }
                }
                
                if ($quotesRegEx !== '') {