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: preserve numeric segments in path matching #142

Merged

Conversation

ebenezerdon
Copy link
Contributor

This PR addresses an issue where numeric segments in the path, such as 0, were being filtered out due to the default behavior of array_filter.

Before Change: The segment 0 would be filtered out, potentially causing a 404 error or incorrect route matching.
After Change: The segment 0 is preserved, ensuring the correct route is matched.

The following changes have been made:

Updated the array_filter call to use a lambda function that filters out only empty strings, ensuring numeric segments like 0 are preserved.
Added a test case to verify that 0 is correctly matched in the path.

ebenezerdon and others added 2 commits September 9, 2024 16:31
- Update array_filter to use a lambda function that filters out only empty strings.
- Ensures numeric segments like '0' are not removed from the path.
- Add test to ensure numeric segments are preserved in path matching
@TorstenDittmann TorstenDittmann merged commit 60c659e into utopia-php:master Sep 9, 2024
4 checks passed
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.

2 participants