| | echo '<div class="diff-binary">Binary files differ</div>'; |
| | } else { |
| | - echo '<div class="diff-content">'; |
| | - echo '<table><tbody>'; |
| | + echo '<div class="diff-content">'; |
| | + echo '<table><tbody>'; |
| | |
| | - foreach ($change['hunks'] as $line) { |
| | - if (isset($line['t']) && $line['t'] === 'gap') { |
| | - echo '<tr class="diff-gap"><td colspan="3">...</td></tr>'; |
| | - continue; |
| | - } |
| | + foreach ($change['hunks'] as $line) { |
| | + if (isset($line['t']) && $line['t'] === 'gap') { |
| | + echo '<tr class="diff-gap"><td colspan="3">...</td></tr>'; |
| | + continue; |
| | + } |
| | |
| | - $class = 'diff-ctx'; |
| | - $char = ' '; |
| | - if ($line['t'] === '+') { $class = 'diff-add'; $char = '+'; } |
| | - if ($line['t'] === '-') { $class = 'diff-del'; $char = '-'; } |
| | + $class = 'diff-ctx'; |
| | + $char = ' '; |
| | + if ($line['t'] === '+') { $class = 'diff-add'; $char = '+'; } |
| | + if ($line['t'] === '-') { $class = 'diff-del'; $char = '-'; } |
| | |
| | - echo '<tr class="' . $class . '">'; |
| | - echo '<td class="diff-num" data-num="' . $line['no'] . '"></td>'; |
| | - echo '<td class="diff-num" data-num="' . $line['nn'] . '"></td>'; |
| | - echo '<td class="diff-code"><span class="diff-marker">' . $char . '</span>' . htmlspecialchars($line['l']) . '</td>'; |
| | - echo '</tr>'; |
| | - } |
| | - echo '</tbody></table>'; |
| | - echo '</div>'; |
| | + echo '<tr class="' . $class . '">'; |
| | + echo '<td class="diff-num" data-num="' . $line['no'] . '"></td>'; |
| | + echo '<td class="diff-num" data-num="' . $line['nn'] . '"></td>'; |
| | + echo '<td class="diff-code"><span class="diff-marker">' . $char . '</span>' . htmlspecialchars($line['l']) . '</td>'; |
| | + echo '</tr>'; |
| | + } |
| | + |
| | + echo '</tbody></table>'; |
| | + echo '</div>'; |
| | } |
| | echo '</div>'; |
| | } |
| | |
| | private function renderBreadcrumbs() { |
| | - $repoUrl = '?repo=' . urlencode( $this->currentRepo['safe_name'] ); |
| | + $safeName = urlencode($this->currentRepo['safe_name']); |
| | + |
| | $crumbs = [ |
| | '<a href="?">Repositories</a>', |
| | - '<a href="' . $repoUrl . '">' . htmlspecialchars($this->currentRepo['name']) . '</a>', |
| | - '<a href="?action=commits' . $repoUrl . '">Commits</a>', |
| | + '<a href="?repo=' . $safeName . '">' . htmlspecialchars($this->currentRepo['name']) . '</a>', |
| | + // Fix 3: Use '&' separator for the repo parameter |
| | + '<a href="?action=commits&repo=' . $safeName . '">Commits</a>', |
| | substr($this->hash, 0, 7) |
| | ]; |