#3852 closed defect (bug) (fixed)
Plugin form submits break if not trailingslashed
Reported by: | boonebgorges | Owned by: | |
---|---|---|---|
Milestone: | 1.6 | Priority: | major |
Severity: | normal | Version: | |
Component: | Core | Keywords: | |
Cc: | sushkov |
Description
Some plugins send post requests to non-trailing-slashed (or otherwise non-canonical) URLs. Our new bp_canonical_redirect() sends them on to the correct URL. But this screws up the data sent in the POST request.
(Note that this should only happen for plugins that catch form submits in a screen function. Anyone hooked to bp_actions or bp_screens or even wp will not have the problem. It's only just before the template is loaded that the redirect takes place.)
We can deal with this one of three ways:
1) Before redirecting a non-canonical redirect, check to see whether $_POST has stuff in it. If so, don't redirect - let the URL resolve.
2) Instead of doing a regular redirect, do a wp_remote_post(), with the original POST payload. This is pretty hackish, but possible.
3) Don't do anything. Warn plugin authors on bpdevel, and let them solve it themselves in their plugins by setting their form actions to a proper URL.
I lean towards (1). Other thoughts?
Change History (5)
#2
@
13 years ago
(3) is my top pick, but (1) probably makes the most sense.
If (1) is chosen, I feel like it would it be good to add a _doing_it_wrong() before we let the URL resolve.
#3
@
13 years ago
- Keywords 2nd-opinion removed
I feel like it would it be good to add a _doing_it_wrong() before we let the URL resolve.
Agreed, but _doing_it_wrong() is marked private, so I'm not going to use it. Maybe in the future we can have our own version of this delightful function.
Thanks a lot Boone for stepping in!
+1 for 1)