Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] prevent exception on command line caused by undefined HTTP Host #2136

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

bahammes
Copy link

Setting TYPO3_PATH_ROOT does not resolve the problem for me, it is also already set correctly by TYPO3.

The cause of the problem is missing HTTP_HOST in $_SERVER on the command line.
If you look at \TYPO3\CMS\Core\Http\NormalizedParams::determineSiteUrl, the parameter $requestDir is not a server directory, but the request host with the script path appended.

On the command line (and also in the backend context) the server params are not passed to the newly created ServerRequest instance in \FluidTYPO3\Flux\Builder\RequestBuilder::getServerRequest, so the HTTP host is always empty.

In TYPO3 >= 11.x a cast to string was added in \TYPO3\CMS\Core\Http\NormalizedParams::determineSiteUrl
so the exception cannot occur there any more.

My suggested solution for this would be to add fallback handling in case the HTTP host is empty:
first check if any site contains a full host name as the base
if no host name is found, set a dummy host as a last resort for TYPO3 10.4 only.
Since this is only used for the temporary Request object in \FluidTYPO3\Flux\Integration\Configuration\SpooledConfigurationApplicator::spoolQueuedContentTypeRegistrations, this should have no effect on anything outside of EXT:flux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant