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

URI Template incorrect when variable name only contains numbers #119

Closed
GrahamCampbell opened this issue Sep 8, 2023 · 1 comment · Fixed by #120
Closed

URI Template incorrect when variable name only contains numbers #119

GrahamCampbell opened this issue Sep 8, 2023 · 1 comment · Fixed by #120

Comments

@GrahamCampbell
Copy link
Member

Bug Report

(Fill in the relevant information below to help triage your issue.)

Information Description
Package league/uri
Version 7.2.1
PHP version 8.2.10
OS Platform Linux

Summary

Template:

https://example.com/foo/{420}

Ends up with [0] being returned as the list of variable names. Expected ["420"].

@GrahamCampbell
Copy link
Member Author

The root cause of this is that there is some bad code that assumes that array keys are always strings, but PHP will convert '420' to 420.

nyamsprod pushed a commit that referenced this issue Sep 8, 2023
Fix broken code that assumes array keys are strings see #119
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 a pull request may close this issue.

1 participant