Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
[js/index.php] Check for readability before opening the git HEAD log --
Browse files Browse the repository at this point in the history
Fixes #5288 -- Thanks Krinkle
  • Loading branch information
Gabriel Schulhof committed Nov 15, 2012
1 parent 756a081 commit 982d7fa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js/index.php
Expand Up @@ -62,7 +62,8 @@
);

function getCommitId() {
$logs = file_get_contents( "../.git/logs/HEAD" );
$gitHeadPath = "../.git/logs/HEAD";
$logs = ( is_readable( $gitHeadPath ) ? file_get_contents( $gitHeadPath ) : false );
if ( $logs ) {
$logs = explode( "\n", $logs );
$n_logs = count( $logs );
Expand Down

0 comments on commit 982d7fa

Please sign in to comment.