Update index.php

dev
SuperDev 3 years ago committed by GitHub
parent 64b54065cd
commit 22f2d2b2e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -67,25 +67,9 @@ return $bytes . ' B';
$plugin_count = count(glob('../../plugins/*', GLOB_ONLYDIR));
// Get version
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $github_api_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_USERAGENT, 'AnonUpload');
$headers = array();
$headers[] = 'Accept: application/vnd.github+json';
$headers[] = 'X-Github-Api-Version: 2022-11-28';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
$server_version = $result['tag_name'];
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close($ch);
$releases = json_decode(file_get_contents("https://api.github.com/repos/supernova3339/anonupload/releases/latest"));
$server_version = $releases['tag_name'];
?>
<?=template_admin_header('Dashboard', 'dashboard')?>

Loading…
Cancel
Save