Skip to content
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

Closed
wants to merge 2 commits into from
Closed

Fix for issue #5631 #5638

wants to merge 2 commits into from

Conversation

emeraldinspirations
Copy link
Contributor

- Add " ( and ) as valid characters in author name
- Add relavent unit tests
@alcohol
Copy link
Member

alcohol commented Aug 31, 2016

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)) {
Copy link

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.

Copy link
Member

@alcohol alcohol Aug 31, 2016

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>.+?)>$

@emeraldinspirations
Copy link
Contributor Author

@alcohol sorry, new to github. What does LGTM mean? P.S. is there some sort of abbreviation key somewhere?

@alcohol
Copy link
Member

alcohol commented Sep 1, 2016

Looks good to me. :-)

@curry684
Copy link
Contributor

curry684 commented Sep 1, 2016

Seldaek pushed a commit that referenced this pull request Sep 2, 2016
@Seldaek
Copy link
Member

Seldaek commented Sep 2, 2016

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.

@Seldaek Seldaek closed this Sep 2, 2016
@Seldaek Seldaek added this to the 1.2 milestone Sep 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants