[TYPO3-core] Reminder: : pageNotFound_handling HTTP status fix
Martin Kutschker
martin.kutschker-n0spam at no5pam-blackbox.net
Wed Jun 28 22:06:30 CEST 2006
Dmitry Dulepov schrieb:
> Hi!
>
> Martin Kutschker wrote:
>> There are two file_get_contents() check. The second is corrected but
>> the first (stream context: file_get_contents($url, $ctx)) is still
>> incorrect.
This is incorrect:
> + } else if (is_array($requestHeaders) && function_exists('stream_context_create')) {
> + $ctx = stream_context_create(array(
> + 'http' => array(
> + 'header' => implode(chr(13) . chr(10), $requestHeaders)
> + )
> + )
> + );
FOPEN comes first
> + if (false !== ($fd = @fopen($url, 'rb', false, $ctx))) {
> + $content = '';
> + while (!feof($fd)) {
> + $content .= fread($fd, 4096);
> + }
> + fclose($fd);
> }
> - fclose ($fp);
> -
> - } elseif (function_exists('file_get_contents')) {
> + elseif (function_exists('file_get_contents')) {
> + $content = @file_get_contents($url, $ctx);
> + }
> + }
FILE_GET_CONTENTS will never get checked
> + elseif (function_exists('file_get_contents')) {
> $content = @file_get_contents($url);
> -
> - } elseif ($fd = @fopen($url,'rb')) {
> - while (!feof($fd)) {
> - $content.=fread($fd, 4096);
Masi
More information about the TYPO3-team-core
mailing list