[TYPO3-core] RFC #9400: Integrate jb_status_code in the TYPO3 core

Steffen Kamper info at sk-typo3.de
Sun Sep 21 12:32:33 CEST 2008


Hi,

Susanne Moog schrieb:
> Steffen Kamper schrieb:
>> Hi,
>>
>> this patch doesn't apply for me
>> "The chunk size did not match the number of added/removed lines"
>>
>> Beside that, why not using a select? It's easy with usage of the 
>> constants and should only contain the 3xx header
> 
> Hi Steffen,
> 
> please try again with attached patch. It should apply correct now.
> 
> I also added a select box with Status 301,302,303 and 307.
> 
> Regards,
> 
> Susanne
> 
> 

ok, now patch applies.

+1 for general, now it makes sense with the select box!

Some remarks that should be modified:
1)
$domain = explode(':', $domain);
should be t3lib_div::trimExplode
2)
$domain = strtolower(ereg_replace('\.$', '', $domain[0]));
using trimExplode makes this ereg_replace useless
strtolower also my dangerous with umlaut-domains
3)
if ($statusCode && defined('t3lib_div::HTTP_STATUS_' . $statusCode)) {
   header(constant('t3lib_div::HTTP_STATUS_' . $statusCode));
   header('Location: '.t3lib_div::locationHeaderUrl($rURL), true, 
$statusCode);
} else {
   header('t3lib_div::HTTP_STATUS_301');
   header('Location: '.t3lib_div::locationHeaderUrl($rURL));
}

sending 2 headers makes the statuscode in 2nd header useless.
Why not use direct the new function t3lib_div::redirect instead of 
header? It's added for exact this purpose.

vg Steffen



More information about the TYPO3-team-core mailing list