Skip to content

fix PHP version parsing; affects [packagist] #11128

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

Merged
merged 2 commits into from
Jun 20, 2025

Conversation

chris48s
Copy link
Member

@chris48s chris48s commented Jun 3, 2025

Closes #11127

Any day we have to touch this code is bad day.

Previously only the 1.0.0-alpha format worked
This PR updates to allow 1.0.0_alpha 1.0.0alpha and 1.0.0.alpha which are uncommon but valid.
This was slightly less trivial than just allowing more separators because of the no separator case (e.g: 1.0.0alpha) so I switched to parsing the version string into bits using this regex https://github.com/composer/semver/blob/46d9139568ccb8d9e7cdd4539cab7347568a5e2e/src/VersionParser.php#L39 and stirred this function around a bit to try and make it a bit less hideous. I may or may not have succeeded.

@chris48s chris48s added bug Bugs in badges and the frontend core Server, BaseService, GitHub auth, Shared helpers labels Jun 3, 2025
Copy link
Contributor

github-actions bot commented Jun 3, 2025

Messages
📖 ✨ Thanks for your contribution to Shields, @chris48s!

Generated by 🚫 dangerJS against b30df49

@chris48s chris48s changed the title fix PHP version parsing fix PHP version parsing; affects [packagist] Jun 3, 2025
@chris48s chris48s requested a review from jNullj June 16, 2025 17:59
Copy link
Contributor

🚀 Updated review app: https://pr-11128-badges-shields.fly.dev

Copy link
Member

@jNullj jNullj left a comment

Choose a reason for hiding this comment

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

LGTM.

@chris48s chris48s added this pull request to the merge queue Jun 20, 2025
Merged via the queue into badges:master with commit fdf3a55 Jun 20, 2025
18 checks passed
@chris48s chris48s deleted the phpversion-11127 branch June 20, 2025 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs in badges and the frontend core Server, BaseService, GitHub auth, Shared helpers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Version badge using Packagist does not respect the include_prereleases parameter
2 participants