Slim: Arguments with url encoded forward slashes no longer work

Created on 19 Mar 2017  Â·  3Comments  Â·  Source: slimphp/Slim

After upgrading from 3.7.0 to 3.8.0, routes that contain a url encoded forward slash no longer work.

Example route: /auth/{code}
Example url: /auth/4%2FGtXcKpxJQk97MyRtHOy_6sPKrLz74-nDkKG6-iz-PIc

This route will no longer be triggered for that URL. I think the culprit is c2d7ae48f836b70b1f9624bcb1c4f0ca18fdd18c, which started URL decoding the URI.

I'm working around this issue currently by double URL encoding the parameter (so the example url from above would be 4%252FGtXcKpxJQk97MyRtHOy_6sPKrLz74-nDkKG6-iz-PIc).

Slim 3 bug

Most helpful comment

Fixed in version 3.8.1.

Thank you for reporting and I'm sorry for the inconvenience.

All 3 comments

That'd be a bc break then… sorry.

Fixed in version 3.8.1.

Thank you for reporting and I'm sorry for the inconvenience.

FWIW I bumped into what I thought was this issue, but the trouble was actually with Apache. The fix was to add AllowEncodedSlashes NoDecode inside my VirtualHost:

https://stackoverflow.com/questions/4390436/need-to-allow-encoded-slashes-on-apache

Hope this helps,
Geoff.

Was this page helpful?
0 / 5 - 0 ratings