Skip to content

Commit

Permalink
fix(misc/footer.php): adds if-statement to make commit-hash a var a…
Browse files Browse the repository at this point in the history
…fter a check instead of just a constant
  • Loading branch information
Ahwxorg committed Jan 12, 2024
1 parent 79a65d9 commit 2ab1768
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions misc/footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
</div>
<div class="git-container">
<?php
$hash = file_get_contents(".git/refs/heads/main");
echo "<a href=\"https://github.com/Ahwxorg/librey/commit/$hash\" target=\"_blank\">" . printftext("latest_commit", $hash) . "</a>";
if (file_exists(".git/refs/heads/main")) {
$hash = file_get_contents(".git/refs/heads/main");
}

echo "<a href='https://github.com/Ahwxorg/Librey/commit/$hash' target='_blank'>" . printftext("latest_commit", $hash) . "</a>";
?>
</div>
</body>
Expand Down

0 comments on commit 2ab1768

Please sign in to comment.