[TYPO3-core] RFC: Bug #5985 - warning when CURLOPT_FOLLOWLOCATION is set
Ernesto Baschny [cron IT]
ernst at cron-it.de
Mon Aug 6 22:00:41 CEST 2007
Martin Kutschker wrote: on 06.08.2007 21:48:
> Branches: trunk, TYPO3_4-1
> Problem: Since PHP 5.2.0, 5.1.5 and 4.4.4 (see PHP Changelog)
> CURLOPT_FOLLOWLOCATION is not allowed when open_basedir or safe_mode are
> enabled. curl_setopt() will issue a warning in this case.
> Solution: suppress output with @.
+1 on that and also backporting to 4.0, if you have the time to do that
and Stucki agrees. Because I see that a lot of web hoster will be
upgrading their PHP versions and older installations will simply start
giving out this warning.
> Optional: check the return value of curl_setopt() and log a failure.
I would output a warning only IF getUrl fails because of not following a
"Location:" header, otherwise we don't need to worry the admin / hoster.
The majority of cases probably don't require to follow a Location in the
Is this something we can recognize? If CURLOPT_FOLLOWLOCATION is OFF
(curl_setopt returned false) and we hit a "Location:" header, what will
curl_exec() return? Maybe we should always switch "CURLOPT_HTTPHEADER"
on and check for that there and then give out a warning instead and then
later strip off the header if the $includeHeader was not wanted.
More information about the TYPO3-team-core