Skip to content

Commit

Permalink
Asset file regex fix for custom versions containing a dash
Browse files Browse the repository at this point in the history
If the unity fs version is something like "2021.3.9f1-gamename", emptyVersion will resolve to "-", making it an invalid version. UABEA had similar issue here nesrak1/UABEA#286
  • Loading branch information
shalzuth committed Oct 31, 2023
1 parent 6ab1475 commit acb8cc5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions AssetTools.NET/Standard/AssetsFileFormat/AssetsFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ public static bool IsAssetsFile(AssetsFileReader reader, long offset, long lengt
}
}

string emptyVersion = Regex.Replace(possibleVersion, "[a-zA-Z0-9\\.\\n]", "");
string fullVersion = Regex.Replace(possibleVersion, "[^a-zA-Z0-9\\.\\n]", "");
string emptyVersion = Regex.Replace(possibleVersion, "[a-zA-Z0-9\\.\\n\\-]", "");
string fullVersion = Regex.Replace(possibleVersion, "[^a-zA-Z0-9\\.\\n\\-]", "");
return emptyVersion == "" && fullVersion.Length > 0;
}

Expand Down

0 comments on commit acb8cc5

Please sign in to comment.