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

return back() is broken in laravel 10.3 version #46388

Closed
aknEvrnky opened this issue Mar 7, 2023 · 8 comments
Closed

return back() is broken in laravel 10.3 version #46388

aknEvrnky opened this issue Mar 7, 2023 · 8 comments

Comments

@aknEvrnky
Copy link

  • Laravel Version: 10.3.0
  • PHP Version: 8.2.3 with FPM apache
  • Database Driver & Version: Ver 15.1 Distrib 10.2.44-MariaDB, for Linux (x86_64) using readline 5.1
  • OS: CentOS 7 with Plesk

Description:

In my controllers, return back() redirects to homepage instead of previous page. This bug only produced on server side for laravel 10.3 version. When I downgrade to laravel 10.2, there are no any mis redirect.

Steps To Reproduce:

I change laravel/framework version to 10.2 from composer.json. There are no anything unusual.
Then, I change the version to 10.3 or ^10.0.
return back() function redirects to homepage.

But It only happens in my production server which is CentOS 7 with plesk.

@browner12
Copy link
Contributor

browner12 commented Mar 7, 2023

Bug is due to this PR:

#46234

552f353

My guess is because it's looking at "url" and not "route" it can't distinguish between the same PATH with a different METHOD.

I am getting the same error, when a POST route is trying to redirect back to the GET route with the same path.

Would probably recommend a revert of the PR at this time.

@aknEvrnky
Copy link
Author

https://github.com/aknEvrnky/laravel-10-3-is-broken.git
you can test is with this repo. Redirect back method fails again in local machine.

@rodrigopedra
Copy link
Contributor

looking into that

@rodrigopedra
Copy link
Contributor

nevermind, I just got what is the problem now. working in a fix

@rodrigopedra
Copy link
Contributor

Fix sent. Fingers crossed =)

@driesvints
Copy link
Member

10.3.1 should revert the faulty pr.

@martinbean
Copy link
Contributor

You wouldn’t believe how long I spent battling this, thinking I was going crazy…

@rodrigopedra
Copy link
Contributor

Sorry to hear that @martinbean 😢

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.

5 participants