Skip to content

Commit c149c24

Browse files
committed
Version validation fix
1 parent b2c5a88 commit c149c24

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/UserAgentParser.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ private function validateVersion()
143143
) {
144144
throw new VersionException("Invalid version format (` $this->version `). See http://semver.org/ for guidelines. In addition, dev/alpha/beta/rc tags is disallowed. See also " . self::RFC_README);
145145
}
146-
$this->version = trim($this->version, '.0');
146+
$new = trim($this->version, '.0');
147+
$this->version = empty($new) ? null : $new;
147148
return true;
148149
}
149150

0 commit comments

Comments
 (0)