From 50811fb2562325fb808c2c1cb3b245a869bfa1da Mon Sep 17 00:00:00 2001 From: phl0 Date: Mon, 27 Mar 2017 13:53:25 +0200 Subject: [PATCH] Check if .git dir exists before accessing it --- include/functions.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/functions.php b/include/functions.php index bf905ca..6b363bb 100644 --- a/include/functions.php +++ b/include/functions.php @@ -851,7 +851,11 @@ function decodeAlias($logLine) { function getGitVersion(){ - exec("git rev-parse HEAD", $output); - return 'GitID #'.substr($output[0],0,7).''; + if (file_exists(".git")) { + exec("git rev-parse HEAD", $output); + return 'GitID #'.substr($output[0],0,7).''; + } else { + return 'GitID unknown'; + } } ?>