When using this module in combination with a hoster that has safe_mode or open_basedir enabled things break apart.

Warning: curl_setopt_array(): CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set in curl_http_request() (regel 204 van /var/www/gemeentemuseum-test/htdocs/sites/all/modules/contrib/chr/chr.module).

Using safe_mode is deprecated but the same can't be said for open_basedir. I run a couple of servers and i need this setting enabled for security reasons. Also a lot of shared hosting accounts will have this setting enabled.

as stated in http://drupal.org/node/1481634 there are a couple of sollutions:

for now, when i disable the following line it all seems to work just as well.

CURLOPT_FOLLOWLOCATION => TRUE,

Comments

lolandese’s picture

Issue summary: View changes

In the file chr.module

curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);

to:
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, FALSE);

karol haltenberger’s picture

Should I expect something to break if the option is disabled?

minoroffense’s picture

Looks like any 3xx request would now fail.

http://curl.haxx.se/libcurl/c/CURLOPT_FOLLOWLOCATION.html

In that case I would lean towards making this a toggled option rather than have it toggled to one or the other value.

The function _chr_curl_set_defaults() could load some variable settings instead.

giupenni’s picture

Same problem.
Fixed with #1