diff options
author | Andrew Dolgov <[email protected]> | 2013-04-16 20:40:14 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-04-16 20:40:14 +0400 |
commit | 438a3ecb04f9889f281ef1c72d6932b8c367deb5 (patch) | |
tree | 77221e1e358b5d7d317257b280c3e87b1e4887ba | |
parent | e2261e177bc9f5308185d91783ca128000c6fd87 (diff) |
disable FOLLOWLOCATION when under open_basedir
-rw-r--r-- | include/functions.php | 4 | ||||
-rw-r--r-- | plugins/af_unburn/init.php | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/include/functions.php b/include/functions.php index 621357ea6..0148d069d 100644 --- a/include/functions.php +++ b/include/functions.php @@ -324,7 +324,7 @@ if (!defined('NO_CURL') && function_exists('curl_init') && !ini_get("open_basedir")) { - if (ini_get("safe_mode")) { + if (ini_get("safe_mode") || ini_get("open_basedir")) { $ch = curl_init(geturl($url)); } else { $ch = curl_init($url); @@ -337,7 +337,7 @@ curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout ? $timeout : FILE_FETCH_CONNECT_TIMEOUT); curl_setopt($ch, CURLOPT_TIMEOUT, $timeout ? $timeout : FILE_FETCH_TIMEOUT); - curl_setopt($ch, CURLOPT_FOLLOWLOCATION, !ini_get("safe_mode")); + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, !ini_get("safe_mode") && !ini_get("open_basedir")); curl_setopt($ch, CURLOPT_MAXREDIRS, 20); curl_setopt($ch, CURLOPT_BINARYTRANSFER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); diff --git a/plugins/af_unburn/init.php b/plugins/af_unburn/init.php index 9f0b6cb0d..f3cc1eefa 100644 --- a/plugins/af_unburn/init.php +++ b/plugins/af_unburn/init.php @@ -29,7 +29,7 @@ class Af_Unburn extends Plugin { if (strpos($article["plugin_data"], "unburn,$owner_uid:") === FALSE) { - if (ini_get("safe_mode")) { + if (ini_get("safe_mode") || ini_get("open_basedir")) { $ch = curl_init(geturl($article["link"])); } else { $ch = curl_init($article["link"]); @@ -38,7 +38,7 @@ class Af_Unburn extends Plugin { curl_setopt($ch, CURLOPT_TIMEOUT, 5); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, true); - curl_setopt($ch, CURLOPT_FOLLOWLOCATION, !ini_get("safe_mode")); + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, !ini_get("safe_mode") && !ini_get("open_basedir")); curl_setopt($ch, CURLOPT_USERAGENT, SELF_USER_AGENT); $contents = @curl_exec($ch); |