diff --git a/src/applications/differential/storage/diff/DifferentialDiff.php b/src/applications/differential/storage/diff/DifferentialDiff.php index 1e245b4bfb..4ccac47a0a 100644 --- a/src/applications/differential/storage/diff/DifferentialDiff.php +++ b/src/applications/differential/storage/diff/DifferentialDiff.php @@ -187,10 +187,10 @@ final class DifferentialDiff extends DifferentialDAO { // Search also backwards for short lines. foreach (array(-1, 1) as $direction) { $offset = $direction; - $orig_code = idx($files[$file], $orig_line + $offset); while (!isset($copies[$line + $offset]) && isset($added[$line + $offset]) && - $orig_code === $added[$line + $offset]) { + idx($files[$file], $orig_line + $offset) === + $added[$line + $offset]) { $lengths["$orig_line:$file"]++; $offset += $direction; } diff --git a/src/applications/differential/storage/hunk/DifferentialHunk.php b/src/applications/differential/storage/hunk/DifferentialHunk.php index b53a6955f2..7892afdcab 100644 --- a/src/applications/differential/storage/hunk/DifferentialHunk.php +++ b/src/applications/differential/storage/hunk/DifferentialHunk.php @@ -33,7 +33,7 @@ final class DifferentialHunk extends DifferentialDAO { continue; } if ($diff_line[0] == '+') { - $lines[$n] = substr($diff_line, 1); + $lines[$n] = (string)substr($diff_line, 1); // substr('+', 1) === false } if ($diff_line[0] != '-') { $n++;