Skip to content

Commit 44da291

Browse files
fix(RESTAPIVersion): convert pkg version to semver using component count not length #930
1 parent 805c7f0 commit 44da291

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/RESTAPIVersion.inc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ class RESTAPIVersion extends Model {
127127
# Locate the version and format it to a standard semantic version format (x.x.x)
128128
$version = str_replace(' ', '', $pkg_line);
129129
$version = explode(':', $version)[1];
130-
$version = strlen($version) === 3 ? $version . '.0' : $version;
130+
$version = substr_count($version, '.') === 1 ? $version . '.0' : $version;
131131
$version = str_replace('_', '.', $version);
132132
return "v$version";
133133
}

0 commit comments

Comments
 (0)