From 07a7d21ae65e4288a32498c9c87dec9a5e39aab9 Mon Sep 17 00:00:00 2001
From: Christopher Smith <chris@jalakai.co.uk>
Date: Sat, 16 Feb 2013 21:11:40 +0000
Subject: [PATCH] fix a couple of diff issues: shouldn't be any need to html
 encode before finding diffs; move quantifier outside regex condition

---
 inc/html.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/inc/html.php b/inc/html.php
index c2723bceb..6c42f6e7b 100644
--- a/inc/html.php
+++ b/inc/html.php
@@ -1163,7 +1163,7 @@ function html_diff($text='',$intro=true,$type=null){
         list($l_head, $r_head, $l_minor, $r_minor) = html_diff_head($l_rev, $r_rev);
     }
 
-    $df = new Diff(explode("\n",hsc($l_text)),explode("\n",hsc($r_text)));
+    $df = new Diff(explode("\n",$l_text),explode("\n",$r_text));
 
     if($type == 'inline'){
         $tdf = new InlineDiffFormatter();
@@ -1238,8 +1238,8 @@ function html_softbreak_callback($match){
 &\#?\\w{1,6};)                        # ... for html entities - we don't want to split them (ok to catch some invalid combinations)
 &\#?\\w{1,6};                         # yes pattern - a quicker match for the html entity, since we know we have one
 |
-[?/,&\#;:]+                           # no pattern - any other group of 'special' characters to insert a breaking character after
-)                                     # end conditional expression
+[?/,&\#;:]                            # no pattern - any other group of 'special' characters to insert a breaking character after
+)+                                    # end conditional expression
 REGEX;
 
   return preg_replace('<'.$regex.'>xu','\0&#8203;',$match[0]);
-- 
GitLab