Skip to content

Commit 2fd0bb8

Browse files
committed
Merge pull request #641 from LearningLocker/issue/version-checking
Fixes #635.
2 parents 944b284 + a4d8bbc commit 2fd0bb8

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

app/views/layouts/sidebars/sidebar_footer.blade.php

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,24 @@
33
<div id="footer">
44
Powered by
55
<a href="http://learninglocker.net" target='_blank'>Learning Locker</a>
6-
<?php $installed_version = file_get_contents(base_path().'/VERSION'); ?>
7-
<?php $latest_version = file_get_contents('https://raw.githubusercontent.com/LearningLocker/learninglocker/master/VERSION'); ?>
6+
<?php
7+
$installed_version = file_get_contents(base_path().'/VERSION');
8+
try {
9+
$latest_version = file_get_contents(
10+
'https://raw.githubusercontent.com/LearningLocker/learninglocker/master/VERSION'
11+
);
12+
} catch (Exception $ex) {
13+
$latest_version = null;
14+
}
15+
?>
816
<a href="https://github.com/LearningLocker/learninglocker/releases/tag/v{{ $installed_version }}">Version {{ $installed_version }}</a>
9-
@if ($latest_version !== $installed_version)
10-
<a href="https://github.com/LearningLocker/learninglocker/releases/latest">You can upgrade to {{ $latest_version }}</a>
11-
@else
12-
<a href="https://github.com/LearningLocker/learninglocker/releases/latest">You have the latest version</a>
13-
@endif
17+
<a href="https://github.com/LearningLocker/learninglocker/releases/latest">
18+
@if ($latest_version === null)
19+
Github Releases
20+
@elseif ($latest_version !== $installed_version)
21+
You can upgrade to {{ $latest_version }}
22+
@else
23+
You have the latest version
24+
@endif
25+
</a>
1426
</div>

0 commit comments

Comments
 (0)