-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for issue #5631 #5638
Fix for issue #5631 #5638
Conversation
- Add " ( and ) as valid characters in author name - Add relavent unit tests
LGTM |
@@ -320,7 +320,7 @@ function ($value) use ($self, $minimumStability) { | |||
*/ | |||
public function parseAuthorString($author) | |||
{ | |||
if (preg_match('/^(?P<name>[- \.,\p{L}\p{N}\'’]+) <(?P<email>.+?)>$/u', $author, $match)) { | |||
if (preg_match('/^(?P<name>[- \.,\p{L}\p{N}\'’\"\(\)]+) <(?P<email>.+?)>$/u', $author, $match)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are not required to escape double quote and parentheses in "character class" (characters sequence inside square brackets). The same is actual for existing dot.
The results probably will be the same, but pattern will look less complicated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is correct. It could be simplified to:
^(?P<name>[- .,\p{L}\p{N}\'’"()]+) <(?P<email>.+?)>$
@alcohol sorry, new to github. What does LGTM mean? P.S. is there some sort of abbreviation key somewhere? |
Looks good to me. :-) |
Thanks, merged in 1.2 so it won't show merged here, but it's in the composer snapshots now and will be in the next 1.2.x release. |
Composer init not accepting my name (similar to issue #3948) #5631