Bug #14916
closed
t3lib_div::getURL() uses cURL only for http protocol
Added by Thorsten Kahler over 19 years ago.
Updated over 14 years ago.
Description
t3lib_div::getURL($url) checks whether the string parameter $url starts with 'http://'. All URLs not fitting to this pattern are opened by fopen().
IMHO this restriction is not neccessary because cURL [1] is able to handle more than half a dozen protocols.
I appended a patch file as an example. It enables ftp, ftps, http, https, gopher and telnet to be red via cURL. cURL options may be set as TYPO3_CONF_VARS or as an optional second parameter of t3lib_div::getURL().
Are there any reasons not to use cURL for those other protocols?
[1] cURL: http://curl.haxx.se/
[2] cURL-functions of PHP: http://www.php.net/manual/en/ref.curl.php
(issue imported from #M1364)
Files
I'm going to fix this. Forgive me Karsten ;-)
I think so too. And IMHO this can safley be added - after one year - into 4.1RC2. I assume that CURL is stable for all protocols.
Thorsten or Martin, can one of you please take over?
Attached is a new version of the patch, made against Trunk @ revision 2377.
Note that other than in the first patch, I didn't remove the three first curl_setopt calls (because Iiii think that this would break the functionality).
Additionally, I have to mention that I can't test the patch right here, so I would be glad if Thorsten will take it over again...
Forget bug_1364_v2.diff please! It contained a syntax error.
I've fixed this in bug_1364_v3.diff and also modified the $TYPO3_CONF_VARS['SYS']['curl'] parameter to be a string (multiline). This way it can be possible to edit the settings using the install tool (see "setDBinit" property).
Last but not least, I think that the properties "curlUse" and "curl" could be merged into one. But this still needs to be done...
Hi Thorsten, can you please test my patch and submit it to the core list, please?
Stucki sent the reminder by accident to Thorsten Koensgen, it should have been Thorsten Kahler. So Thorsten, can you send the patch, please?
cheers
Ingmar
coul also be considered to be a featuer
Fixed in SVN for http, https, ftp, ftps, sftp and scp. Other protocols like telnet won't work reasonably with getURL().
Also available in: Atom
PDF