We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a1dd98f commit c4422bdCopy full SHA for c4422bd
lib/Configuration.php
@@ -244,9 +244,13 @@ public static function getVersion() {
244
if(@is_readable($headFile)) {
245
246
$revisionHashFile = '.git/' . substr(file_get_contents($headFile), 5, -1);
247
- $branchName = explode('/', $revisionHashFile)[3];
248
- if(file_exists($revisionHashFile)) {
249
- return 'git.' . $branchName . '.' . substr(file_get_contents($revisionHashFile), 0, 7);
+ $parts = explode('/', $revisionHashFile);
+
+ if(isset($parts[3])) {
250
+ $branchName = $parts[3];
251
+ if(file_exists($revisionHashFile)) {
252
+ return 'git.' . $branchName . '.' . substr(file_get_contents($revisionHashFile), 0, 7);
253
+ }
254
}
255
256
0 commit comments