mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-24 02:38:50 +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');
|
$git = file($this->project_dir.'/.git/HEAD');
|
||||||
$head = explode('/', $git[0], 3);
|
$head = explode('/', $git[0], 3);
|
||||||
|
|
||||||
|
if (!isset($head[2])) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return trim($head[2]);
|
return trim($head[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,6 +89,10 @@ class GitVersionInfo
|
||||||
$head = file($filename);
|
$head = file($filename);
|
||||||
$hash = $head[0];
|
$hash = $head[0];
|
||||||
|
|
||||||
|
if (!isset($head[0])) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return substr($hash, 0, $length);
|
return substr($hash, 0, $length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue