Skip to content

Commit

Permalink
Merge pull request #2 from smarques/master
Browse files Browse the repository at this point in the history
Fix version validation

Thanks for helping!
  • Loading branch information
wcoppens committed Feb 27, 2019
2 parents a2de2fc + fe0d0a3 commit 8ecb233
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/WPMLInstaller/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ protected function validateVersion($version, $packageName)
{
// \A = start of string, \Z = end of string
// See: http://stackoverflow.com/a/34994075
$major_minor_patch_optional = '/\A\d\.\d(?:\.\d{1,2})?(?:\.\d)?\Z/';
$major_minor_patch_optional = '\A\d\.\d{1,2}(?:\.\d{1,2})?(?:\.\d)?\Z';
if (!preg_match($major_minor_patch_optional, $version)) {
throw new \UnexpectedValueException(
'The version constraint of ' . $packageName .
Expand Down Expand Up @@ -331,4 +331,4 @@ protected function removeParameterFromUrl($url, $parameter)
$pattern = "/(&$parameter=[^&]*)/";
return preg_replace($pattern, '', $url);
}
}
}

1 comment on commit 8ecb233

@smarques
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I have a typo there, will make a new PR in a second :<

Please sign in to comment.