Posted by mkalkbrenner on April 1, 2009 at 3:27pm
| Project: | Secure Pages |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | grendzy |
| Status: | fixed |
Issue Summary
If pages section at admin/build/securepages contains an empty line (what usually happens if someone hits ENTER after the last record) the front page toggles between HTTP and HTTPS each time you reload. The reason for this is that the empty line gets transformed into an empty or condition for the regular expression that matches urls and the empty or condition matches the front page.
I attached a simple patch that eliminates empty lines at the end of the list of pages when validating the admin form.
| Attachment | Size |
|---|---|
| securepages.admin_.inc_.prevent-front-page-toggle.patch | 502 bytes |
Comments
#1
See #286333: Blank line in securepages_secure textarea causes Homepage redirection for additional information.
Patch seems reasonable, didn't test it yet.
#2
This looks ok, but you need to add an update which will do fix up the current variables when the update.php is run.
#3
Thanks for figuring this out! :)
#4
Thank you! you saved my day
#5
Legend! Thanks a bunch!
#6
I believe this was causing a redirect loop in firefox on one of my sites. I removed the trailing newline and it started working immediately.
#7
Patch works. But remove the trailing newline before applying this patch.
#8
MUCHOS GRACIAS! Thank you a ton.
#9
can you not just re-save the settings form to have your values trimmed?
obviously the redirection would need to be disabled on the settings form in order to get in to the site :-)
#10
My front page still alternates between http and https even after the patch.
#11
Did you save your settings again after the patch?
#12
Please see http://drupal.org/node/587000#comment-4519010.
#13
It seems the front page matching is broken anyway. Here's a new patch:
#14
I applied this patch on version 6.x-1.9 and it seems to have worked fine. Thanks so much!
#15
I believe this is fixed in the 6.x-2.x branch. Please test and report back if you can.
#16
There have been no further reports of this problem in the 6.x-2.x branch, and we have tests now too.