Fix Windows Server updates being named Windows 10

This commit is contained in:
whatever127 2019-08-28 16:26:16 +02:00
parent 78642059cc
commit 875621fa57
2 changed files with 9 additions and 6 deletions

View File

@ -192,9 +192,10 @@ function parseFetchUpdate($updateInfo, $out, $arch, $ring, $flight, $build, $sku
return array('error' => 'EMPTY_FILELIST'); return array('error' => 'EMPTY_FILELIST');
} }
preg_match('/ProductReleaseInstalled Name\=".*\.(.*?)" Version\="10\.0\.(.*?)"/', $updateInfo, $info); preg_match('/ProductReleaseInstalled Name\="(.*?)\..*\.(.*?)" Version\="10\.0\.(.*?)"/', $updateInfo, $info);
$foundArch = strtolower($info[1]); $foundType = strtolower($info[1]);
$foundBuild = $info[2]; $foundArch = strtolower($info[2]);
$foundBuild = $info[3];
$updateTitle = preg_grep('/<Title>.*<\/Title>/', $updateMeta); $updateTitle = preg_grep('/<Title>.*<\/Title>/', $updateMeta);
sort($updateTitle); sort($updateTitle);
@ -217,9 +218,11 @@ function parseFetchUpdate($updateInfo, $out, $arch, $ring, $flight, $build, $sku
$updateTitle = preg_replace("/ ?\d{4}-\d{2}\w* ?| ?$foundArch ?| ?x64 ?/i", '', $updateTitle); $updateTitle = preg_replace("/ ?\d{4}-\d{2}\w* ?| ?$foundArch ?| ?x64 ?/i", '', $updateTitle);
if(!preg_match("/$foundBuild/i", $updateTitle)) { if($foundType == 'server')
$updateTitle = str_replace('Windows 10', 'Windows Server', $updateTitle);
if(!preg_match("/$foundBuild/i", $updateTitle))
$updateTitle = $updateTitle.' ('.$foundBuild.')'; $updateTitle = $updateTitle.' ('.$foundBuild.')';
}
preg_match('/UpdateID=".*?"/', $updateInfo, $updateId); preg_match('/UpdateID=".*?"/', $updateInfo, $updateId);
preg_match('/RevisionNumber=".*?"/', $updateInfo, $updateRev); preg_match('/RevisionNumber=".*?"/', $updateInfo, $updateRev);

View File

@ -16,7 +16,7 @@ limitations under the License.
*/ */
function uupApiVersion() { function uupApiVersion() {
return '1.26.0'; return '1.26.1';
} }
require_once dirname(__FILE__).'/auths.php'; require_once dirname(__FILE__).'/auths.php';