[TYPO3-core] RFC: getURL fix for error cases and curl

Ernesto Baschny [cron IT] ernst at cron-it.de
Tue Oct 17 19:08:41 CEST 2006


Hi,

Martin, you are correct. I have just commited the fix to TRUNK (rev
1763) and TYPO3_4-0 (rev 1764).

I added a note about it to http://bugs.typo3.org/view.php?id=3637 which
is somehow related to this issue, and for which Karsten has already
prepared a bugfix.

Cheers,
Ernesto


Martin Kutschker schrieb am 17.10.2006 16:10:

>> This is a SVN patch request.
>>
>> Problem:
>> When using "curl" with t3lib_div::getURL() and retrieving an URL that
>> returns an 404, you get the 404 error-page back as "content", instead of
>> a false that would indicate that there was an error in the transfer.
>>
>> You can see the problem in "action" in this situation:
>>
>> - configure a proxy and enable "curl" in the install tool
>> - Delete all *.zip files in typo3temp
>> - Go to "Ext.Manager" and to the "Translation handling"
>> - Select some languages
>> - "Update from repository"
>>
>> You will get a couple of "ERR" "Unpacking the language pack failed".
>> This is because it is trying to unpack the html-error message, you can
>> see their contents in typo3temp after the errors.
>>
>> Fix:
>> The curl_setopt($ch, CURLOPT_FAILONERROR, 1) addition will make
>> curl_exec return "false" which is what getURL currently does without
>> curl on error situations. I am pretty sure this shouldn't break any
>> existing application, except if we want to get the 404 content back
>> (which would currently only work with curl anyway).
> 
> Is this in now? From your description it should be in TYPO3_4-0 too.
> 
> +1 (just a reminder as I gave it already on 7th August)
> 
> Masi



More information about the TYPO3-team-core mailing list