array_push($notices, "It is highly recommended to enable support for CURL in PHP.");
}
+ if (function_exists("curl_init") && ini_get("open_basedir")) {
+ array_push($notices, "CURL and open_basedir combination breaks support for HTTP redirects. See the FAQ for more information.");
+ }
+
if (count($notices) > 0) {
print_notice("Configuration check succeeded with minor problems:");
if (!class_exists("Readability")) require_once(dirname(dirname(__DIR__)). "/lib/readability/Readability.php");
- if (function_exists("curl_init")) {
+ if (!defined('NO_CURL') && function_exists('curl_init') && !ini_get("open_basedir")) {
+
$ch = curl_init($article["link"]);
+
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_NOBODY, true);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, !ini_get("open_basedir"));
+ curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_USERAGENT, SELF_USER_AGENT);
@$result = curl_exec($ch);
$found = $this->inline_stuff($article, $doc, $xpath);
- if (function_exists("curl_init") && !$found && $this->host->get($this, "enable_readability") &&
+ if (!defined('NO_CURL') && function_exists("curl_init") && !$found && $this->host->get($this, "enable_readability") &&
mb_strlen(strip_tags($article["content"])) <= 150) {
if (!class_exists("Readability")) require_once(dirname(dirname(__DIR__)). "/lib/readability/Readability.php");
function hook_article_filter($article) {
$owner_uid = $article["owner_uid"];
- if (!function_exists("curl_init") || ini_get("open_basedir"))
+ if (defined('NO_CURL') || !function_exists("curl_init") || ini_get("open_basedir"))
return $article;
if ((strpos($article["link"], "feedproxy.google.com") !== FALSE ||
function hook_article_filter($article) {
- $owner_uid = $article["owner_uid"];
+ if (defined('NO_CURL') || !function_exists("curl_init"))
+ return $article;
$charset_hack = '<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>