Fallback to ANONADDY_VERSION env var if empty

This commit is contained in:
CrazyMax 2022-07-30 21:39:10 +02:00
parent a605891cb2
commit a8d1243dcc
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7

View file

@ -9,8 +9,14 @@ class AppVersionController extends Controller
{
public function index()
{
$parts = str(Version::version())->explode('.');
$ver = str(Version::version());
if (strlen($ver) == 0) {
$ver = getenv('ANONADDY_VERSION', true);
if ($ver == null) {
$ver = '';
}
}
$parts = $ver->explode('.');
return response()->json([
'version' => Version::version(),
'major' => (int) isset($parts[0]) ? $parts[0] : null,