Check version number on version.md file (#280)

This commit is contained in:
mchev
2025-04-05 10:16:23 +02:00
committed by GitHub
parent ba243b28a9
commit 2aa17513e1
3 changed files with 6 additions and 5 deletions

View File

@@ -3,9 +3,9 @@
namespace App\Http\Controllers\V1\Admin\Update;
use App\Http\Controllers\Controller;
use App\Models\Setting;
use App\Space\Updater;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\File;
class CheckVersionController extends Controller
{
@@ -26,7 +26,8 @@ class CheckVersionController extends Controller
set_time_limit(600); // 10 minutes
$channel = $request->get('channel', 'stable');
$response = Updater::checkForUpdate(Setting::getSetting('version'), $channel);
$version = preg_replace('~[\r\n]+~', '', File::get(base_path('version.md')));
$response = Updater::checkForUpdate($version, $channel);
return response()->json($response);
}