Properly handle a form action url that does not begin with the base path

Created on 27 June 2013, over 11 years ago
Updated 26 November 2024, 27 days ago

Problem/Motivation

To recreate this problem, install panels 3.3 and the latest dev release of Secure Pages. Enable the node template panel, add a variant for a content type, add a field from that entity, and try to edit the style. It will fail with:

An AJAX HTTP request terminated abnormally.
Debugging information follows.
Path: http://foo.bar.com/ttps%3A//foo.bar.com/panels/ajax/editor/style-settings/panel_context%253Anode_view%253Anode_view_panel_context_3/region/center
StatusText: 
ResponseText: 
ReadyState: 4

In some places, the Panels code sets an absolute URL as the form action. When encountered in securepages_form_alter(), the URL passes the test of securepages_can_alter_url() and so is considered for alteration. However, the code block only handles the use case of a relative path, not an absolute path.

As shown above, the action URL has a doubling of the domain name with the second occurrence missing the leading "h" in the protocol.

See #2029839: Replace absolute URLs with relative URLs β†’ in the Panels queue.

Proposed resolution

Handle the use case of an absolute URL.

Remaining tasks

Review, test.

User interface changes

None.

API changes

None.

Related Issues

May be related to πŸ› Update Secure Pages default parameters to ignore */ajax/* urls Closed: outdated .

πŸ› Bug report
Status

Closed: outdated

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States solotandem

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