[TYPO3-core] RFC: #4379 - pageNotFound_handling ignores forceCharset setting

Michael Stucki michael at typo3.org
Fri Nov 17 19:43:30 CET 2006


Hi Martin,

>> Problem:
>> If $TYPO3_CONF_VARS[FE][pageNotFound_handling] is triggered and pointing
>> to an URL, TYPO3 ignores the setting of $TYPO3_CONF_VARS[BE][forceCharset
>> ] and outputs a wrong charset in the header.
>> 
>> Solution:
>> - Add support for multy-line $header parameter in
>>   tslib_fe::pageNotFoundHandler()
>> 
>> - Fetch also the headers of the 404 document
>> 
>> - Forward only those headers that are specified in $forwardHeaders
>>   (currently this is only the Content-Type which usually contains the
>>   charset on the same line).
>> 
>> Branches: TYPO3_4-0 and Trunk
> 
> I think we can do better than fetching the same URL twice:
> 
> $content = t3lib_div::getURL($code, 0, $headerArr);
> $header = t3lib_div::getURL($code, 2, $headerArr);
> 
> As the header is delimited by an empty line (\r\n is net line break) then
> it should work like this:

Agree, changed that.

> $url = t3lib_div::getURL($code, 1, $headerArr);
> $n = strpos("\r\n\r\n", $url);
> $header = substr($url,0,$n+2);
> $header = substr($url,$n+4);

I agree with your idea, but I really don't like using PHPs str_* functions.
Don't you find this hard to read?

> And the preg_quote is IMHO not necessary. A header may contain nothing
> that needs to be escaped.

I don't think so. Just picked this example from your message header:

| User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)

At least the slash needs to be quoted for sure!

> Otherwise a +1 by looking at the code.

OK, so I have changed my patch according to your suggestion. Tested it and
committed to Trunk and TYPO3_4-0. For your information, the change is
attached again.

- michael
-- 
Use a newsreader! Check out
http://typo3.org/community/mailing-lists/use-a-news-reader/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug_4379_v3.diff
Type: text/x-diff
Size: 1882 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20061117/bc103f3a/attachment.bin 


More information about the TYPO3-team-core mailing list