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

Add quotes to milestone in case title contains spaces #17

Merged

Conversation

asgrim
Copy link
Contributor

@asgrim asgrim commented Nov 18, 2016

Discovered a bug where if the milestone title contains a space (e.g. 1.0.0 (initial release)), the search fails to find any issues. Simple fix here is to always quote the milestone, I see no adverse affects with milestones that do not contain spaces (e.g. 1.0.0).

@@ -82,7 +82,7 @@

$client->setUri(
'https://api.github.com/search/issues?q=' . urlencode(
'milestone:' . $milestonePayload['title']
'milestone:"' . $milestonePayload['title'] . '"'
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

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

Since it was brought to the table - what happens with a " in the milestone?

Copy link
Contributor Author

@asgrim asgrim Nov 21, 2016

Choose a reason for hiding this comment

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

Good catch, I've added a straightforward replacement of " to \" which is all that is required. I looked into using addslashes() but it is only " that must be escaped (and escaping others such as \' will result in the search failing.

@weierophinney weierophinney added this to the 2.1.3 milestone Feb 22, 2017
@weierophinney weierophinney merged commit 2a532f5 into weierophinney:master Feb 22, 2017
weierophinney added a commit that referenced this pull request Feb 22, 2017
Add quotes to milestone in case title contains spaces
weierophinney added a commit that referenced this pull request Feb 22, 2017
@weierophinney
Copy link
Owner

Thanks, @asgrim!

@weierophinney weierophinney modified the milestones: 2.1.3, 2.2.0 Feb 22, 2017
@asgrim asgrim deleted the bugfix/quote-for-milestone-search branch February 22, 2017 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants