diff --git a/fetchupd.php b/fetchupd.php index ac9165f..bc9fc46 100644 --- a/fetchupd.php +++ b/fetchupd.php @@ -122,7 +122,7 @@ function uupFetchUpd( consoleLogger('Fetching information from the server...'); $composerArgs = [$arch, $flight, $ring, $build, $sku, $type, $flags]; $out = sendWuPostRequestHelper('client', 'composeFetchUpdRequest', $composerArgs); - if($out['error'] != 200) { + if($out === false || $out['error'] != 200) { consoleLogger('The request has failed'); return array('error' => 'WU_REQUEST_FAILED'); } diff --git a/get.php b/get.php index 5a0c6f7..97f2d3a 100644 --- a/get.php +++ b/get.php @@ -399,7 +399,7 @@ function uupGetOnlineFiles($updateId, $rev, $info, $cacheRequests, $type) { $composerArgs = [$updateId, $info, $rev, $type]; $out = sendWuPostRequestHelper('clientSecured', 'composeFileGetRequest', $composerArgs); - if($out['error'] != 200) { + if($out === false || $out['error'] != 200) { consoleLogger('The request has failed'); return array('error' => 'WU_REQUEST_FAILED'); } diff --git a/shared/auths.php b/shared/auths.php index c1a154f..6fbb4f6 100644 --- a/shared/auths.php +++ b/shared/auths.php @@ -60,6 +60,9 @@ function uupEncryptedData() { if(empty($cookieInfo)) { $data = sendWuPostRequestHelper('client', 'composeGetCookieRequest', [], false); + if($data === false || $data['error'] != 200) + return false; + $cookieInfo = uupSaveCookieFromResponse($data['out']); } diff --git a/shared/main.php b/shared/main.php index 5157b01..3707724 100644 --- a/shared/main.php +++ b/shared/main.php @@ -16,7 +16,7 @@ limitations under the License. */ function uupApiVersion() { - return '1.43.1'; + return '1.43.2'; } require_once dirname(__FILE__).'/auths.php'; diff --git a/shared/requests.php b/shared/requests.php index 94148c6..c90e134 100644 --- a/shared/requests.php +++ b/shared/requests.php @@ -362,8 +362,11 @@ XML; // Composes POST data for fetching the latest update information from Windows Update function composeFetchUpdRequest($arch, $flight, $ring, $build, $sku = 48, $type = 'Production', $flags = []) { - $device = uupDevice(); $encData = uupEncryptedData(); + if($encData === false) + return false; + + $device = uupDevice(); $uuid = genUUID(); $createdTime = time(); diff --git a/shared/utils.php b/shared/utils.php index 5707c38..f406d76 100644 --- a/shared/utils.php +++ b/shared/utils.php @@ -102,6 +102,9 @@ function sendWuPostRequestHelper( ]; $postData = call_user_func_array($postComposer, $postComposerArgs); + if($postData === false) + return false; + $data = sendWuPostRequestInternal($endpoints[$endpoint], $postData, $saveCookie); if($data['error'] == 500 && preg_match('/(ConfigChanged|CookieExpired|InvalidCookie)<\/ErrorCode>/', $data['out'])) {