Better software update, experimental

This commit is contained in:
markseu 2018-07-20 20:03:20 +02:00
parent acd7575fe6
commit 74c748d48a

6
system/plugins/update.php Normal file → Executable file
View file

@ -5,7 +5,7 @@
class YellowUpdate
{
const VERSION = "0.7.13";
const VERSION = "0.7.14";
var $yellow; //access to API
var $updates; //number of updates
@ -802,6 +802,10 @@ class YellowUpdate
{
$urlRequest = "https://raw.githubusercontent.com/".$matches[1]."/".$matches[2];
}
if(preg_match("#^https://github.com/(.+)/archive/master.zip$#", $url, $matches))
{
$urlRequest = "https://codeload.github.com/".$matches[1]."/zip/master";
}
$curlHandle = curl_init();
curl_setopt($curlHandle, CURLOPT_URL, $urlRequest);
curl_setopt($curlHandle, CURLOPT_USERAGENT, "Mozilla/5.0 (compatible; DatenstromYellow/".YellowCore::VERSION."; SoftwareUpdater)");