Project

General

Profile

Actions

Bug #16600

closed

CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set

Added by Schmid Valentin over 17 years ago. Updated almost 16 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2006-09-27
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.0
PHP Version:
5
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Since uprgrading from 4.0.0 to 4.0.2 I noticed a lot of warnings in my php-error-log.
The warning looks like this:
PHP Warning: curl_setopt() [<a href='function.curl-setopt'>function.curl-setopt</a>]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /..../typo3_src-4.0.2/t3lib/class.t3lib_div.php on line 2322

I think the option CURLOPT_FOLLOWLOCATION should be set optional by a configuration parameter.

My php version is 5.1.6 and open_basedir is set

Workaround: uncomment the line 2322 in class.t3lib_div.php
or set it like the following
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);

(issue imported from #M4292)


Related issues 1 (0 open1 closed)

Is duplicate of TYPO3 Core - Bug #17479: Alert in FE: "...CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir..."ClosedMartin Kutschker2007-07-17

Actions
Actions #1

Updated by Bjrn Kraus about 17 years ago

I've the some problem with PHP 5.2.1. It seems that this relies on a security change made in PHP 4.4.4 and PHP 5.1.5 (see changelog). There are some solutions posted in the PHP function comments (see http://de.php.net/curl_setopt).

Since this part of TYPO3 is called quite often it would be good to have it fixed quickly.

Actions #2

Updated by Bob Amir almost 17 years ago

"There are some solutions posted in the PHP function comments (see http://de.php.net/curl_setopt). [^]

Since this part of TYPO3 is called quite often it would be good to have it fixed quickly."

Any advice on where do exactly we apply the fix recommended in the PHP function comments above?

Actions #3

Updated by Bjrn Kraus almost 17 years ago

The file and line where the error occurs is posted in the bug description.

How to implement a solution depends on what functionality is implied by setting the CURL option.

Actions #4

Updated by Bjrn Kraus almost 17 years ago

I took a further look at the problem and IMHO the solution suggested on php.net is too oversized to fit the needs. So I suggest simply to mute the waring by prefixing the curl_setopt call with an '@' or adding an if statement to check whether a base_dir is set or the safe_mode is enabled:

if (ini_get('open_basedir') '' && ini_get('safe_mode' 'Off'))
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

Perhaps the second solution is better to recognize why this change was made.

If $TYPO3_CONF_VARS['SYS']['curlUse'] is set and CURLOPT_FOLLOWLOCATION can't be activated t3lib::getURL() won't follow redirects. Perhaps this should be added somewhere as "know issue".

Actions #5

Updated by Franz Holzinger over 16 years ago

This is similar or the same with #17479.

Actions

Also available in: Atom PDF