Bug #25366
closedcross domain links to pages with different protocol point to wrong (current) domain
0%
Description
If you have multidomain installation, linking to pages on other domains than the current domain won't work if the target page has another url_scheme (http / https) than the current page. In these cases the link resulting from the typolink function will point to the current domain instead of the domain which carries the target page. In my installation realurl is installed, but it shouldn't make any difference.
My search for the reason pointed me to the file class.tslib_content.php, where an additional bracket pair led to the desired result. See attached patch.
(issue imported from #M18000)
Files
Updated by Markus over 13 years ago
Can confirm this Bug.
TYPO3 4.5.2
- DAM
- Templavoila
- realurl
Attached Patch fixed this Problem
Updated by Steffen Gebert over 13 years ago
Sounds reasonable!
Klaus, are you able to push this change to the review system Gerrit?
See http://wiki.typo3.org/Contribution_Walkthrough for explanations.
If you want to do so (which is appreciated :)) and have trouble: Tomorrow's TYPO3 Bug Day is the "Git Edition". If you need help, just join IRC and you get support during your first steps.
P.S: Please leave the added comment out.
Updated by Steffen Gebert over 13 years ago
Hi Klaus,
I just reproduced this issue. However, your fix doesn't work for me. Do you use absRefPrefix?
For me, this piece of code (which directly follows the code you've modified) causes trouble:
// If go for an absolute link, add site_path if it's not taken care about by absRefPrefix if (!$GLOBALS['TSFE']->config['config']['absRefPrefix'] && $targetDomain !== '') { $targetDomain = $currentDomain . rtrim(t3lib_div::getIndpEnv('TYPO3_SITE_PATH'), '/'); }
As $targetDomain is the other domain and I don't have absRefPrefix set, $targetDomain is replaced with $currentDomain, which causes the described error.
Updated by Steffen Gebert over 13 years ago
Ah, I just noticed that there has been a recent change, which causes the problems I realized.
Your patch itself is right and helps, but the piece of code cited above also has to be fixed.
Maybe by additionally checking for
&& $absoluteUrlScheme === parse_url(t3lib_div::getIndpEnv('TYPO3_REQUEST_URL'), PHP_URL_SCHEME)
? But hopfefully there's a cleaner way.
Updated by Klaus Storch over 13 years ago
Hi Steffen,
sorry for the late and short response, I was occupied with other things.
Yes, I use absRefPrefix, so I wouldn't have noticed the problem. And my patch took the 4.5.2 release version as basis.
As the SITE_PATH logic can't work with cross-domain links anyway (there is potentially a different TYPO3_SITE_PATH for each domain), I assume it's safe to add the check for
&& strpos($currentDomain,$targetDomain)!==false
or even more direct:
&& ($currentDomain==$targetDomain)
instead, which looks more elegant to me and answers the question we want to check directly: Do we have a cross domain link here? This missing check seems like a bug for me anyway.
I went halfway through the gerrit/contribution process, and I'm not sure wether I find the time to push the proposed changes to gerrit in the next days. The toolchain seems very sophisticated, but a bit complicated for the git-illiterate among us (like me). The possibility of uploading the diff-files directly to the review system via web interface would probably be a big step forward for those who work with non-distributed version control systems like subversion.
Updated by Alexander Opitz over 10 years ago
- Status changed from New to Needs Feedback
- Target version deleted (
0) - TYPO3 Version set to 4.5
- Is Regression set to No
Hi,
as this issue is very old. Does the problem still exists within newer versions of TYPO3 CMS (6.2.3)?
Updated by Alexander Opitz about 10 years ago
- Status changed from Needs Feedback to Closed
No feedback within the last 90 days => closing this issue.
If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.