Project

General

Profile

Actions

Bug #57749

closed

typolink(): Incorrect generation for cross-protocol link when port is set in Host Header

Added by Anno v. Heimburg about 10 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Target version:
-
Start date:
2014-04-08
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
On Location Sprint

Description

Situation:

  1. TYPO3 runs behind a proxy, that proxy sets an explicit :80 for HTTP and :443 for HTTPS traffic in the Host-Header. The Host-Header thus looks like this: Host: mydomain.com:80
  2. Links to HTTPS-only pages are present on HTTP-Pages

Expected result:
Links to the HTTPS-Pages are generated correcty, i.e. https://mydomain.com/secure/page

Actual result:
Links to the HTTPS-Pages incorrectly contain the HTTP port and thus do not work, i.e. https://mydomain.com:80/secure/page

Reason:
The logic when generating a link (typolink-function) goes like this:

  1. Check targetDomain of link. If targetDomain is identical to current domain (this is the case), set targetDomain to ""
  2. Check whether an HTTPS-link is desired.
  3. If HTTPS is desired AND targetDomain is blank (which now is the case), set the targetDomain to the contents of the Host-Header (which, in this case, includes :80)
  4. Prepend targetDomain to generated link

And thus, the link gets an incorrect port. In my opinion, in step1, targetDomain should only be set to "" if target domain AND protocol are the same as current domain and protocol, as "" seems to indicate no change.

Actions

Also available in: Atom PDF