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

Percent sign in URL results in a URI malformed error when using route().current() #777

Closed
jbardnz opened this issue Oct 15, 2024 · 1 comment · Fixed by #778
Closed

Percent sign in URL results in a URI malformed error when using route().current() #777

jbardnz opened this issue Oct 15, 2024 · 1 comment · Fixed by #778
Assignees

Comments

@jbardnz
Copy link

jbardnz commented Oct 15, 2024

Ziggy version

2.3.0

Laravel version

11.28.0

Description

My website has profile section where you can view users usernames, the structure is site.com/user/{username}

We have a requirement to allow users to use the % sign in their username. I'm making sure to urlencode the username to prevent issues on the server side.

So for example a URL might be site.com/user/john%25

The issue comes when I call route().current('user.profile'), I get the following error in my browser: URIError: URI malformed

image

Ziggy call and context

route().current('user.profile')

Ziggy configuration

Can provide if needed.

Route definition

Route::get('/user/{username}', [PageController::class, 'userProfile'])->name('user.profile');
@jbardnz
Copy link
Author

jbardnz commented Oct 20, 2024

@bakerkretzmar Thanks so much for fixing this so quickly - really appreciate it!

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.

2 participants