diff --git a/fetchupd.php b/fetchupd.php index 927d852..59b4cf3 100644 --- a/fetchupd.php +++ b/fetchupd.php @@ -43,15 +43,7 @@ function uupFetchUpd( $ids['builds'] = array(); } - $ids = $ids['builds']; - foreach($ids as $val) { - $builds[] = $val['build']; - } - - $builds = array_unique($builds); - rsort($builds); - - $build = $builds[0]; + $build = $ids['builds'][0]['build']; unset($builds, $ids); } @@ -193,9 +185,9 @@ function parseFetchUpdate($updateInfo, $out, $arch, $ring, $flight, $build, $sku } preg_match('/ProductReleaseInstalled Name\="(.*?)\..*\.(.*?)" Version\="10\.0\.(.*?)"/', $updateInfo, $info); - $foundType = strtolower($info[1]); - $foundArch = strtolower($info[2]); - $foundBuild = $info[3]; + $foundType = @strtolower($info[1]); + $foundArch = @strtolower($info[2]); + $foundBuild = @$info[3]; $updateTitle = preg_grep('/.*<\/Title>/', $updateMeta); sort($updateTitle); @@ -267,6 +259,11 @@ function parseFetchUpdate($updateInfo, $out, $arch, $ring, $flight, $build, $sku consoleLogger("Update ID: ".$updateString); consoleLogger("--- UPDATE INFORMATION ---"); + if((!$foundBuild) && (!$foundArch)) { + consoleLogger('No architecture nor build number specified! What the hell is this?'); + return array('error' => 'BROKEN_UPDATE'); + } + if(preg_match('/Corpnet Required/i', $updateTitle)) { consoleLogger('Skipping corpnet only update...'); return array('error' => 'CORPNET_ONLY_UPDATE'); diff --git a/shared/main.php b/shared/main.php index fc7410a..719bcc3 100644 --- a/shared/main.php +++ b/shared/main.php @@ -16,7 +16,7 @@ limitations under the License. */ function uupApiVersion() { - return '1.27.1'; + return '1.27.2'; } require_once dirname(__FILE__).'/auths.php'; diff --git a/shared/requests.php b/shared/requests.php index 1a776aa..496ff0f 100644 --- a/shared/requests.php +++ b/shared/requests.php @@ -108,6 +108,10 @@ function branchFromBuild($build) { $branch = '19h1_release'; break; + case 18363: //18363 is a fake build based on 18362 + $branch = '19h1_release'; + break; + default: $branch = 'rs_prerelease'; break;