Fixed a invalid offset notice that can be occuring in GitVersionInfo.

This commit is contained in:
Jan Böhmer 2020-03-29 18:34:01 +02:00
parent 445a3ddff6
commit b6dfea9c7d

View file

@ -64,6 +64,9 @@ class GitVersionInfo
$git = file($this->project_dir.'/.git/HEAD');
$head = explode('/', $git[0], 3);
if (!isset($head[2])) {
return null;
}
return trim($head[2]);
}
@ -86,6 +89,10 @@ class GitVersionInfo
$head = file($filename);
$hash = $head[0];
if (!isset($head[0])) {
return null;
}
return substr($hash, 0, $length);
}