Skip to content

Commit

Permalink
version_compare() fix for invalid version string
Browse files Browse the repository at this point in the history
- ".0.0" caused IndexOutOfRangeException
  • Loading branch information
jakubmisek committed Dec 30, 2018
1 parent 6f734dd commit 27ca30f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Peachpie.Library/Miscellaneous.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ static string[] VersionToArray(string version)
{
if (last != '.')
{
if (sb.Length == 0)
{
sb.Append('0'); // prepend leading '.' with '0' // TODO: test case and rewrite 'version_compare()'
}

sb.Append(last = '.');
}
}
Expand Down

0 comments on commit 27ca30f

Please sign in to comment.