Form actions aren't properly altered to http/https when the site is installed in a subdirectory

Created on 20 December 2011, about 13 years ago
Updated 26 November 2024, 27 days ago

With the patch from πŸ› DrupalWebTestCase->getAbsoluteUrl should use internal browser's base URL Postponed: needs info applied and running Drupal at the server root (e.g., http://drupal.dev), I get three test failures in the Secure Pages test suite. However, when running Drupal in a subdirectory (e.g., http://localhost/drupal), I get five failures.

It looks like this is due to a bug where form actions aren't properly being altered to http/https in this case. There is some code in securepages_can_alter_url() that tries to play around with $base_path and $base_url, and that's what's causing it. For the life of me I can't figure out what that code is trying to do, but I'm pretty sure it's unnecessary, and it's definitely broken. The attached patch removes it.

Applying this patch results in consistent test behavior regardless of whether the site is installed in a subdirectory (3 failures either way).

πŸ› Bug report
Status

Closed: outdated

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States David_Rothstein

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡¦Ukraine AstonVictor

    I'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

Production build 0.71.5 2024