mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-04 06:25:22 +01:00
Fixed a invalid offset notice that can be occuring in GitVersionInfo.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user