diff --git a/fetchupd.php b/fetchupd.php index 3a48b96..927d852 100644 --- a/fetchupd.php +++ b/fetchupd.php @@ -164,7 +164,7 @@ function uupFetchUpd( 'updateTitle' => $updateArray[0]['updateTitle'], 'foundBuild' => $updateArray[0]['foundBuild'], 'arch' => $updateArray[0]['arch'], - 'fileWrite' => $updateArray[0]['foundBuild'], + 'fileWrite' => $updateArray[0]['fileWrite'], 'updateArray' => $updateArray, ); } diff --git a/get.php b/get.php index f55feeb..e52ea8d 100644 --- a/get.php +++ b/get.php @@ -37,6 +37,14 @@ function uupGetFiles( ) { uupApiPrintBrand(); + if(!$updateId) { + return array('error' => 'UNSPECIFIED_UPDATE'); + } + + if(!uupApiCheckUpdateId($updateId)) { + return array('error' => 'INCORRECT_ID'); + } + $info = @file_get_contents('fileinfo/'.$updateId.'.json'); if(empty($info)) { $info = array( diff --git a/listeditions.php b/listeditions.php index 4f64dcd..7d780ef 100644 --- a/listeditions.php +++ b/listeditions.php @@ -24,6 +24,10 @@ function uupListEditions($lang = 'en-us', $updateId = 0) { $info = uupUpdateInfo($updateId); } + if(!$lang) { + return array('error' => 'UNSUPPORTED_LANG'); + } + if(isset($info['info'])) $info = $info['info']; if(isset($info['build'])) { diff --git a/shared/main.php b/shared/main.php index a76702e..81d958f 100644 --- a/shared/main.php +++ b/shared/main.php @@ -16,7 +16,7 @@ limitations under the License. */ function uupApiVersion() { - return '1.26.2'; + return '1.27.0'; } require_once dirname(__FILE__).'/auths.php'; diff --git a/shared/utils.php b/shared/utils.php index 5d59a64..026e3c5 100644 --- a/shared/utils.php +++ b/shared/utils.php @@ -113,3 +113,10 @@ function uupDumpApiGetDebug() { $data = parse_ini_file('debug.ini'); return $data; } + +function uupApiCheckUpdateId($updateId) { + return preg_match( + '/^[\da-fA-F]{8}-([\da-fA-F]{4}-){3}[\da-fA-F]{12}(_rev\.\d+)?$/', + $updateId + ); +}