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 throws syntax error with misleading message #18

Closed
ptomulik opened this issue May 14, 2020 · 2 comments
Closed

Uri throws syntax error with misleading message #18

ptomulik opened this issue May 14, 2020 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@ptomulik
Copy link

Bug Report

An exception with misleading message is thrown from Uri::assertValidState().

Information Description
Version master
PHP version
OS Platform

Summary

If Uri validation fails at this line, the error message always refers to "data" scheme. I believe it should mention the actual scheme of the URI being validated.

Standalone code, or other way to reproduce the problem

\League\Uri\Uri::createFromString('file://example.org:80/home/jsmith/foo.txt');

Expected result

League/Uri/Exceptions/SyntaxError with message 'The uri `file://example.org:80/home/jsmith/foo.txt` is invalid for the file scheme'

Actual result

League/Uri/Exceptions/SyntaxError with message 'The uri `file://example.org:80/home/jsmith/foo.txt` is invalid for the data scheme'
@nyamsprod nyamsprod self-assigned this May 14, 2020
@nyamsprod nyamsprod added the bug Something isn't working label May 14, 2020
@nyamsprod
Copy link
Member

The fixe will be part of the next release. I've already fixed it in a local branch.

@nyamsprod
Copy link
Member

the fix has landed on the master branch this issue is resolved.

@nyamsprod nyamsprod transferred this issue from thephpleague/uri Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants