Actions
Bug #57749
closedtypolink(): Incorrect generation for cross-protocol link when port is set in Host Header
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Site Handling, Site Sets & 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:
- 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
- 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:
- Check targetDomain of link. If targetDomain is identical to current domain (this is the case), set targetDomain to ""
- Check whether an HTTPS-link is desired.
- 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)
- 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