Bug #28788
closedPageErrorHandler+curl+linux = headers output in pageNotFoundHandler
0%
Description
As topic says, if using pageNotFoundHandler set to fetch a page using CURL, then headers from the request are output to the client because of an incorrect assumption in:
typo3/sysext/cms/tslib/class.tslib_fe.php line 1481/4760 (31%), col 59/76 // Header and content are separated by an empty line list($header, $content) = explode(CRLF . CRLR, $res, 2);
When on linux, CRLF is not used to separate request header and body in CURL returns. Instead, a universal constant must be used: PHP_EOL which is cross-platform.
typo3/sysext/cms/tslib/class.tslib_fe.php line 1481/4760 (31%), col 59/76 // Header and content are separated by an empty line list($header, $content) = explode(PHP_EOL . PHP_EOL, $res, 2);
Noticed on 4.5.3 and 4.6-beta1.
Updated by Claus Due over 13 years ago
Sorry, the "CRLR" was a typo, "CRLF . CRLF" is the current split string.
Updated by Steffen Gebert over 13 years ago
Thanks for the report. Sounds very reasonable!
Could you please start a request for review in our review system Gerrit? Tutorial
Thanks!
Updated by Thorsten Kahler over 13 years ago
- Category set to Frontend
- Status changed from New to Accepted
- Priority changed from Must have to Should have
- Target version set to 1305
- Complexity set to easy
I decrease the priority to "Should have" because TYPO3 is still running despite of that bug.
IMHO should be fixed 4.4, 4.5 and master.
Updated by Oliver Hader over 13 years ago
- Target version changed from 1305 to 1341
Updated by Gerrit Code Review about 11 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/25121
Updated by Gerrit Code Review about 11 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/25121
Updated by Ro!and Schorr almost 11 years ago
Should be patched in TYPO3 CMS 6.1.5 as well.
--- TypoScriptFrontendController.php 2013-11-29 11:04:38.000000000 +0100 +++ TypoScriptFrontendController.php-patched 2013-11-29 11:05:21.000000000 +0100 @@ -1954,7 +1954,7 @@ ); $res = \TYPO3\CMS\Core\Utility\GeneralUtility::getUrl($code, 1, $headerArr); // Header and content are separated by an empty line - list($header, $content) = explode(CRLF . CRLF, $res, 2); + list($header, $content) = explode(PHP_EOL . PHP_EOL, $res, 2); $content .= CRLF; if (FALSE === $res) { // Last chance -- redirect
Updated by Markus Klein almost 10 years ago
- Status changed from Under Review to Rejected
- Complexity deleted (
easy) - Is Regression set to No
Debugged that with curl and without curl on master (7.x). Content returned by curl is always with CRLFCRLF.