fixed a bug of not showing whitespaces at the end of different lines in the full diff view
This commit is contained in:
parent
db114f4aa4
commit
cac4433101
@ -327,8 +327,7 @@ class SubversionModel extends Model
|
|||||||
if ($curoline < $oline)
|
if ($curoline < $oline)
|
||||||
{
|
{
|
||||||
$nl = fgets($ofile);
|
$nl = fgets($ofile);
|
||||||
|
$line = rtrim($nl, "\r\n");
|
||||||
$line = rtrim($nl);
|
|
||||||
if ($ent) $line = replaceEntities($line, $rep);
|
if ($ent) $line = replaceEntities($line, $rep);
|
||||||
|
|
||||||
//$listing[$index]["rev1line"] = hardspace($line);
|
//$listing[$index]["rev1line"] = hardspace($line);
|
||||||
@ -346,7 +345,7 @@ class SubversionModel extends Model
|
|||||||
{
|
{
|
||||||
$nl = fgets($nfile);
|
$nl = fgets($nfile);
|
||||||
|
|
||||||
$line = rtrim($nl);
|
$line = rtrim($nl, "\r\n");
|
||||||
if ($ent) $line = replaceEntities($line, $rep);
|
if ($ent) $line = replaceEntities($line, $rep);
|
||||||
|
|
||||||
//$listing[$index]["rev2line"] = hardspace($line);
|
//$listing[$index]["rev2line"] = hardspace($line);
|
||||||
@ -388,7 +387,7 @@ class SubversionModel extends Model
|
|||||||
|
|
||||||
$mod = $line{0};
|
$mod = $line{0};
|
||||||
|
|
||||||
$line = rtrim(substr($line, 1));
|
$line = rtrim(substr($line, 1), "\r\n");
|
||||||
if ($ent) $line = replaceEntities($line, $rep);
|
if ($ent) $line = replaceEntities($line, $rep);
|
||||||
|
|
||||||
//if (strip_tags($line) == '') $line = ' ';
|
//if (strip_tags($line) == '') $line = ' ';
|
||||||
@ -501,7 +500,7 @@ class SubversionModel extends Model
|
|||||||
|
|
||||||
if (!feof($ofile))
|
if (!feof($ofile))
|
||||||
{
|
{
|
||||||
$line = rtrim(fgets($ofile));
|
$line = rtrim(fgets($ofile), "\r\n");
|
||||||
if ($ent) $line = replaceEntities($line, $rep);
|
if ($ent) $line = replaceEntities($line, $rep);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -517,8 +516,8 @@ class SubversionModel extends Model
|
|||||||
|
|
||||||
if (!feof($nfile))
|
if (!feof($nfile))
|
||||||
{
|
{
|
||||||
$line = rtrim(fgets($nfile));
|
$line = rtrim(fgets($nfile), "\r\n");
|
||||||
if ($ent) $line = replaceEntities(rtrim(fgets($nfile)), $rep);
|
if ($ent) $line = replaceEntities(rtrim(fgets($nfile), "\r\n"), $rep);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!feof($nfile)) {
|
if (!feof($nfile)) {
|
||||||
|
@ -136,7 +136,6 @@ function format_diff ($a, $b, $css_class)
|
|||||||
if ($b == '') return htmlspecialchars($a);
|
if ($b == '') return htmlspecialchars($a);
|
||||||
|
|
||||||
// TODO: word by word comparison to be less position dependent
|
// TODO: word by word comparison to be less position dependent
|
||||||
|
|
||||||
$cc = '';
|
$cc = '';
|
||||||
$diffstart = -1;
|
$diffstart = -1;
|
||||||
$alen = strlen($a);
|
$alen = strlen($a);
|
||||||
@ -171,7 +170,9 @@ function format_diff ($a, $b, $css_class)
|
|||||||
{
|
{
|
||||||
if ($alen > $blen)
|
if ($alen > $blen)
|
||||||
{
|
{
|
||||||
|
$cc .= sprintf ('<span class="%s">', $css_class);
|
||||||
$cc .= htmlspecialchars(substr ($a, $blen, $alen - $blen));
|
$cc .= htmlspecialchars(substr ($a, $blen, $alen - $blen));
|
||||||
|
$cc .= '</span>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user