Project

General

Profile

Actions

Bug #28788

closed

PageErrorHandler+curl+linux = headers output in pageNotFoundHandler

Added by Claus Due over 12 years ago. Updated over 9 years ago.

Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2011-08-05
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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.

Actions #1

Updated by Claus Due over 12 years ago

Sorry, the "CRLR" was a typo, "CRLF . CRLF" is the current split string.

Actions #2

Updated by Steffen Gebert over 12 years ago

Thanks for the report. Sounds very reasonable!

Could you please start a request for review in our review system Gerrit? Tutorial

Thanks!

Actions #3

Updated by Thorsten Kahler over 12 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.

Actions #4

Updated by Oliver Hader over 12 years ago

  • Target version changed from 1305 to 1341
Actions #5

Updated by Ernesto Baschny almost 11 years ago

  • Target version deleted (1341)
Actions #6

Updated by Gerrit Code Review over 10 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

Actions #7

Updated by Gerrit Code Review over 10 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

Actions #8

Updated by Ro!and Schorr over 10 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
Actions #9

Updated by Markus Klein over 9 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.

Actions

Also available in: Atom PDF