mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-23 18:28:49 +02:00
Fixed a invalid offset notice that can be occuring in GitVersionInfo.
This commit is contained in:
parent
445a3ddff6
commit
b6dfea9c7d
1 changed files with 7 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue