Dashboard | Fix redirect after unlocking#3733
Merged
tvdeyen merged 1 commit intoAlchemyCMS:mainfrom Mar 7, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3733 +/- ##
=======================================
Coverage 97.47% 97.47%
=======================================
Files 314 314
Lines 8303 8303
=======================================
Hits 8093 8093
Misses 210 210 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Currently, when unlocking a page from the dashboard, the user is always redirected to the pages index. The `unlock` form action supplies a `redirect_to` parameter, which allows to redirect back to the dashboard. Currently this parameter is a URL, e.g. `https://example.com/admin/dashboard`. The URL then fails the `BaseController#is_safe_redirect_path?` check, because that method only supports paths. It never matches against URLs with domains and scheme. We therefore set the `redirect_to` parameter to the path, instead of the URL.
87a9411 to
0a51d02
Compare
This was referenced Mar 7, 2026
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation and see the Github Action logs for details |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this pull request for?
Currently, when unlocking a page from the dashboard, the user is always redirected to the pages index.
The
unlockform action supplies aredirect_toparameter, which allows to redirect back to the dashboard. Currently this parameter is a URL, e.g.https://example.com/admin/dashboard.The URL then fails the
BaseController#is_safe_redirect_path?check, because that method only supports paths. It never matches against URLs with domains and scheme.We therefore set the
redirect_toparameter of theunlockform action to the path, instead of the URL.Checklist