continue;
}
- foreach ($file['lines'] AS $hunk)
+ if (is_array($file['lines']))
{
- $lines = '';
-
- $show['hunk'] = true;
- $low = $file['revision']['low'];
- $high = $file['revision']['high'];
-
- $filename = (preg_match('/' . preg_quote($filename, '/') . '$/', $input->in['path']) ? $input->in['path'] : BSFunctions::FetchSourcePath($input->in['path']) . $filename);
- $rlow = ConstructLink('view', $input->in['repos'], $filename, $low);
- $rhigh = ConstructLink('view', $input->in['repos'], $filename, $high);
- eval('$lines .= "' . $template->fetch('diff_line') . '";');
-
- foreach ($hunk AS $key => $line)
+ foreach ($file['lines'] AS $hunk)
{
- $show['hunk'] = false;
- if ($line['act'] == '+')
- {
- $class = 'diff_add';
- }
- else if ($line['act'] == '-')
- {
- $class = 'diff_del';
- }
- else
+ $lines = '';
+
+ $show['hunk'] = true;
+ $low = $file['revision']['low'];
+ $high = $file['revision']['high'];
+
+ $filename = (preg_match('/' . preg_quote($filename, '/') . '$/', $input->in['path']) ? $input->in['path'] : BSFunctions::FetchSourcePath($input->in['path']) . $filename);
+ $rlow = ConstructLink('view', $input->in['repos'], $filename, $low);
+ $rhigh = ConstructLink('view', $input->in['repos'], $filename, $high);
+ eval('$lines .= "' . $template->fetch('diff_line') . '";');
+
+ foreach ($hunk AS $key => $line)
{
- $class = 'diff_norm';
+ $show['hunk'] = false;
+ if ($line['act'] == '+')
+ {
+ $class = 'diff_add';
+ }
+ else if ($line['act'] == '-')
+ {
+ $class = 'diff_del';
+ }
+ else
+ {
+ $class = 'diff_norm';
+ }
+
+ $line['line_clean'] = FormatCode($line['line']);
+
+ eval('$lines .= "' . $template->fetch('diff_line') . '";');
}
-
- $line['line_clean'] = FormatCode($line['line']);
-
- eval('$lines .= "' . $template->fetch('diff_line') . '";');
+ eval('$hunktpl .= "' . $template->fetch('diff_hunk') . '";');
}
- eval('$hunktpl .= "' . $template->fetch('diff_hunk') . '";');
}
if (is_array($file['props']))