diff --git a/codepot/src/codepot/models/subversionmodel.php b/codepot/src/codepot/models/subversionmodel.php index 5edd499a..79f9d344 100644 --- a/codepot/src/codepot/models/subversionmodel.php +++ b/codepot/src/codepot/models/subversionmodel.php @@ -327,8 +327,7 @@ class SubversionModel extends Model if ($curoline < $oline) { $nl = fgets($ofile); - - $line = rtrim($nl); + $line = rtrim($nl, "\r\n"); if ($ent) $line = replaceEntities($line, $rep); //$listing[$index]["rev1line"] = hardspace($line); @@ -346,7 +345,7 @@ class SubversionModel extends Model { $nl = fgets($nfile); - $line = rtrim($nl); + $line = rtrim($nl, "\r\n"); if ($ent) $line = replaceEntities($line, $rep); //$listing[$index]["rev2line"] = hardspace($line); @@ -388,7 +387,7 @@ class SubversionModel extends Model $mod = $line{0}; - $line = rtrim(substr($line, 1)); + $line = rtrim(substr($line, 1), "\r\n"); if ($ent) $line = replaceEntities($line, $rep); //if (strip_tags($line) == '') $line = ' '; @@ -501,7 +500,7 @@ class SubversionModel extends Model if (!feof($ofile)) { - $line = rtrim(fgets($ofile)); + $line = rtrim(fgets($ofile), "\r\n"); if ($ent) $line = replaceEntities($line, $rep); } @@ -517,8 +516,8 @@ class SubversionModel extends Model if (!feof($nfile)) { - $line = rtrim(fgets($nfile)); - if ($ent) $line = replaceEntities(rtrim(fgets($nfile)), $rep); + $line = rtrim(fgets($nfile), "\r\n"); + if ($ent) $line = replaceEntities(rtrim(fgets($nfile), "\r\n"), $rep); } if (!feof($nfile)) { diff --git a/codepot/src/codepot/views/code_diff.php b/codepot/src/codepot/views/code_diff.php index 83097190..6d6e74e9 100644 --- a/codepot/src/codepot/views/code_diff.php +++ b/codepot/src/codepot/views/code_diff.php @@ -136,7 +136,6 @@ function format_diff ($a, $b, $css_class) if ($b == '') return htmlspecialchars($a); // TODO: word by word comparison to be less position dependent - $cc = ''; $diffstart = -1; $alen = strlen($a); @@ -171,7 +170,9 @@ function format_diff ($a, $b, $css_class) { if ($alen > $blen) { + $cc .= sprintf ('', $css_class); $cc .= htmlspecialchars(substr ($a, $blen, $alen - $blen)); + $cc .= ''; } }