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

Deprecation Warning: urldecode() #5895

Closed
bogdancondorachi opened this issue Oct 31, 2023 · 3 comments · Fixed by #6369
Closed

Deprecation Warning: urldecode() #5895

bogdancondorachi opened this issue Oct 31, 2023 · 3 comments · Fixed by #6369
Labels
type: bug 🐛 Is a bug; fixes a bug

Comments

@bogdancondorachi
Copy link

bogdancondorachi commented Oct 31, 2023

Description

I found this by mistake when I've added two slashes or more after localhost:8000 and followed by a page (ex. localhost:8000//panel)

When two slashes are added I get this deprecated warning:
Deprecated: urldecode(): Passing null to parameter #1 ($string) of type string is deprecated in C:\Users\bogda\OneDrive\Projects\htdocs\double-check\vendor\getkirby\cms\router.php on line 3

image

When more than two slashes are added I get this deprecated notice:
Deprecated: Automatic conversion of false to array is deprecated in C:\Users\bogda\OneDrive\Projects\htdocs\double-check\vendor\getkirby\cms\src\Http\Uri.php on line 114

image

Expected behavior
I gues it should not show any errors or correct the url maybe??

To reproduce

  1. Go to localhost:port and place two or more slashes after it followed by panel or anything else
  2. You should see a deprecated warning with two slashes and a deprecated notice when more than two slashes placed

Your setup

Kirby Version
3.9.7

Console output
nothing relevant

Your system (please complete the following information)

  • OS: Windows 11
  • Browser: Edge
  • Version: 118

Additional context
I've tested on other projects and the errors are to be reproduced only on local dev and not on production.

Edit: I've tested this on a starterkit with v4 and it still happens

@bogdancondorachi bogdancondorachi changed the title [v3] Deprecation Warning: urldecode() Deprecation Warning: urldecode() Nov 8, 2023
@distantnative
Copy link
Member

I've tried to replicate it but I cannot reproduce the deprecation notice.
What I do see is that adding additional slashes in between results in the home page being shown. This could be expected.

@distantnative distantnative added the needs: replication 🔬 Requires a sample to reproduce the issue label Nov 23, 2023
@bogdancondorachi
Copy link
Author

bogdancondorachi commented Nov 23, 2023

For me, it happens on any project I'm trying localhost:8000//panel for example. I expect to get the home page but IDK what's up with this deprecation notice.

If you have any ideas on how to test this further, I'm eager to try out

image

image

image

@lukasbestle
Copy link
Member

I can reproduce this with the built-in PHP server.

parse_url('//panel', PHP_URL_PATH) returns null because the double-slash is treated as the beginning of a protocol-relative URL. So urlencode(null) triggers the deprecation notice and the homepage is rendered.

@lukasbestle lukasbestle added type: bug 🐛 Is a bug; fixes a bug and removed needs: replication 🔬 Requires a sample to reproduce the issue labels Nov 24, 2023
@bastianallgeier bastianallgeier added this to the 4.2.0 milestone Mar 25, 2024
@distantnative distantnative linked a pull request Mar 25, 2024 that will close this issue
1 task
@bastianallgeier bastianallgeier modified the milestones: 4.2.0, 4.2.x Mar 27, 2024
@distantnative distantnative removed this from the 4.4.x milestone Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Is a bug; fixes a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants