From 6a524aa0c0b65133874bd1a9e72982b8ee0a1e43 Mon Sep 17 00:00:00 2001 From: eraseyourknees <112027564+eraseyourknees@users.noreply.github.com> Date: Wed, 7 Sep 2022 01:28:19 +0200 Subject: [PATCH] Move download link replacements --- get.php | 2 +- shared/utils.php | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/get.php b/get.php index d98e437..596de3d 100644 --- a/get.php +++ b/get.php @@ -329,7 +329,7 @@ function uupGetFiles( $filesNew = array(); foreach($filesInfoKeys as $val) { $filesNew[$val] = $filesInfoList[$val]; - $filesNew[$val]['url'] = str_replace('http://tlu.dl.delivery.mp.microsoft.com', 'https://uupdump.sf.tlu.dl.delivery.mp.microsoft.com', $filesInfoList[$val]['url']); + $filesNew[$val]['url'] = uupApiFixDownloadLink($filesInfoList[$val]['url']); } $files = $filesNew; diff --git a/shared/utils.php b/shared/utils.php index 0275a47..6a78915 100644 --- a/shared/utils.php +++ b/shared/utils.php @@ -155,3 +155,14 @@ function uupApiBuildMajor($build) { return intval(explode('.', $build)[0]); } + +function uupApiFixDownloadLink($link) { + if($link == null) + return null; + + return str_replace( + 'http://tlu.dl.delivery.mp.microsoft.com', + 'https://uupdump.sf.tlu.dl.delivery.mp.microsoft.com', + $link + ); +}