Skip to content

Commit

Permalink
fixed inline diff when ignoring whitespaces for PHP 4.x (#309)
Browse files Browse the repository at this point in the history
  • Loading branch information
dirk-thomas committed Dec 14, 2010
1 parent 4690981 commit af4913c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions include/diff_inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,13 +346,15 @@ function inline_diff($all, $ignoreWhitespace, $highlighted, $newtname, $oldtname
} else {
$whitespaces = array(' ', "\t", "\n", "\r");
$mappedFromLines = array();
foreach ($fromLines as &$line) {
foreach ($fromLines as $k => $line) {
$line = rtrim($line, "\n\r");
$fromLines[$k] = $line;
$mappedFromLines[] = str_replace($whitespaces, array(), $line);
}
$mappedToLines = array();
foreach ($toLines as &$line) {
foreach ($toLines as $k => $line) {
$line = rtrim($line, "\n\r");
$toLines[$k] = $line;
$mappedToLines[] = str_replace($whitespaces, array(), $line);
}
$diff = @new Text_MappedDiff($fromLines, $toLines, $mappedFromLines, $mappedToLines);
Expand Down

0 comments on commit af4913c

Please sign in to comment.