Problem/Motivation
The code in securepages_drupal_goto_alter() should leave unchanged a path related to an external URL. It seems clear that the matching path and role redirect rules apply only to the current site (with the running code) and that the current site has no basis to change the path on another site.
Proposed resolution
See patch attached to first comment, which includes a test.
Remaining tasks
Nothing.
User interface changes
None.
API changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | securepages-leave_external_url-1962854-9.patch | 1.57 KB | mrmikedewolf |
| #1 | 1962854-leave-external-url.patch | 2.1 KB | solotandem |
Comments
Comment #1
solotandem commentedAttached patch implements proposed resolution.
Comment #2
rob230 commentedSecure Pages breaks a number of my sites that have another module using drupal_goto() to send the user to an external page.
The simple change of returning if the URL is external is a good solution.
Comment #3
dan_lennox commentedI've tested this patch on a production site and it's working great.
Comment #4
dan_lennox commentedI've tested this patch on a production site and it's working great.
Comment #5
dan_lennox commentedI've tested this patch on a production site and it's working great.
Comment #6
dan_lennox commentedI've tested this patch on a production site and it's working great.
Comment #7
dan_lennox commentedApologies for the duplicate comments... on submission it's posted 4 comments and caused an nginx error...
Comment #8
merzikain commentedThe patch is working for me on a production website.
Comment #9
mrmikedewolf commentedGreat patch! Just a small update. I removed hunk 1 of the modifications to salesforce.test as this change has been rolled into the newest version of the module.
Comment #10
rob230 commentedSorry, can you explain what you have changed and what salesforce.test is?
From what I can see you've removed the call to _testGoto() but not removed the function itself. And there doesn't seem to be an equivalent test for external paths in the latest dev version so I'm not sure why it's removed.
Comment #11
steven jones commentedGreat patch in #1! Just quick review:
Can we be sure that $is_https was TRUE at the start of the test?
Or should we revert this to the previous value, whatever that is?
Also, I arrived at this issue because I have a full path going through
drupal_alter, i.e. one that already has https at the front, but is a URL for the current Drupal site, so it's handled as an external URL, and secure pages changes it to a http URL :(Comment #12
astonvictor commentedI'm closing it because the issue was created a long time ago without any further steps.
if you still need it then raise a new one.
thanks