Update p_check_update.php

This commit is contained in:
Hani Rouatbi
2022-08-26 10:11:31 +01:00
committed by GitHub
parent dc93e7026a
commit cc2731e9f5

View File

@@ -54,12 +54,13 @@ if ($current_smt == 'check')
//get data from kleeja github repo
if (! ($version_data = $cache->get('kleeja_repo_version')))
{
$version_data = [];
$github_data = FetchFile::make(KLEEJA_VERSION_CHECK_LINK)->setTimeOut(100)->get();
if (! empty($github_data))
{
$latest_release = json_decode($github_data, true);
$version_data = null;
if (json_last_error() === JSON_ERROR_NONE)
{
@@ -103,7 +104,7 @@ if ($current_smt == 'check')
}
$data = [
'version_number' => $version_data['version'],
'version_number' => isset($version_data['version']) ? $version_data['version'] : null,
'last_check' => time()
];