Legacy backend preview url generation generates URL with duplicated protocol
[TASK] Rework pseudo-site backend preview url generation
When there is no site configuration, no TCEMAN.preview
configuration and no sys_domain record available, the host
URL needs to be derived from TYPO3_SITE_URL.
This recently broke (and was fixed). Due to wrong logic
the protocol was added twice, resulting in URLs like:
It initially broke due to the site handling features, probably
A condition became dead, due to $domain being always set,
when it was null before that change (if a sys_domain record
could not be found).
The bug was fixed by adding an additional condition (without
removing the dead "else" condition) in https://review.typo3.org/c/58177/
This patch tries to clean this up by removing the new condition
(introduced in #58177) and rather restructure the code.
To circumvent those bugs and to avoid confusion what $domain
actually refers to (now always including the protocol) the
code is refactored to not re-assign $domain over and over again.
Tested-by: TYPO3com <email@example.com>
Reviewed-by: Susanne Moog <firstname.lastname@example.org>
Reviewed-by: Georg Ringer <email@example.com>
Tested-by: Georg Ringer <firstname.lastname@example.org>
Tested-by: Susanne Moog <email@example.com>
Reviewed-by: Andreas Fernandez <firstname.lastname@example.org>
Tested-by: Andreas Fernandez <email@example.com>
Reviewed-by: Anja Leichsenring <firstname.lastname@example.org>
Tested-by: Anja Leichsenring <email@example.com>