mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-01-29 11:58:23 +01:00
[Core] Fix notice of undefined offset when in detached HEAD state. (#1569)
This commit is contained in:
parent
a1dd98ff82
commit
c4422bdbb5
@ -244,9 +244,13 @@ final class Configuration {
|
|||||||
if(@is_readable($headFile)) {
|
if(@is_readable($headFile)) {
|
||||||
|
|
||||||
$revisionHashFile = '.git/' . substr(file_get_contents($headFile), 5, -1);
|
$revisionHashFile = '.git/' . substr(file_get_contents($headFile), 5, -1);
|
||||||
$branchName = explode('/', $revisionHashFile)[3];
|
$parts = explode('/', $revisionHashFile);
|
||||||
if(file_exists($revisionHashFile)) {
|
|
||||||
return 'git.' . $branchName . '.' . substr(file_get_contents($revisionHashFile), 0, 7);
|
if(isset($parts[3])) {
|
||||||
|
$branchName = $parts[3];
|
||||||
|
if(file_exists($revisionHashFile)) {
|
||||||
|
return 'git.' . $branchName . '.' . substr(file_get_contents($revisionHashFile), 0, 7);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user