[BUGFIX] Pass original extbase response object to form framework finishers 49/55849/2
authorBenjamin Franzke <bfr@qbus.de>
Wed, 21 Feb 2018 00:21:50 +0000 (01:21 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 8 Mar 2018 01:54:19 +0000 (02:54 +0100)
commit5400029f906105197a68b43f2d5a0812b4ebcaef
treee1aa496e88988aa5b9a8cec212749747aec2869a
parent2bba5cc7f3d1c2a90bad7bb487e33a8ccdca5e86
[BUGFIX] Pass original extbase response object to form framework finishers

The original extbase response was passed as second parameter
to ObjectManager->get() – that did effectively nothing. The second get()
parameter is not a fallback parameter (as probably supposed by the author)
but the first constructor argument (but Response has no constructor).
Now, rather use a coalesce operator to use the original response or create
an own, if required.

Also handle the StopActionException in case no extbase response
is available (e.g. when rendered through FluidTemplateContentObject).

Due to this fixes the redirect finisher can be adapted to stop echo'ing
the response content on it's own. Directly echo'ing the response content
caused wrong Content-Length headers to be generated as the core didn't
know that content has been echo'ed. (The redirect response contains both a
header based redirect and html meta redirect; due to early echo that meta
redirect is prepended to the regular html output, and is missing in the
Content-Length calculation.)
That casused certain server environments (e.g. gzip, keep-alive,
proxy) and browsers (e.g. Android, Opera desktop) to display gzip
compressed data as garbage in the browser.

Resolves: #83822
Releases: master, 8.7
Change-Id: I4cb56e7626ea786d4b5265782b5940e60e3d2ec0
Reviewed-on: https://review.typo3.org/55849
Tested-by: TYPO3com <no-reply@typo3.com>
Tested-by: Joonas Kauhanen <joonas.kauhanen@gmail.com>
Reviewed-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Tested-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/form/Classes/Domain/Finishers/RedirectFinisher.php
typo3/sysext/form/Classes/ViewHelpers/RenderViewHelper.php