]> git.wh0rd.org - tt-rss.git/commitdiff
fix broken redirects
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 20 Mar 2013 08:15:06 +0000 (12:15 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 20 Mar 2013 08:15:06 +0000 (12:15 +0400)
include/functions.php
plugins/af_unburn/init.php

index 62699e175392ac567df7c0f4ba57e5aaf1c92b1d..a055d1edf2f945fc95c24f9486cd5f57920a2926 100644 (file)
 
                        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout ? $timeout : 15);
                        curl_setopt($ch, CURLOPT_TIMEOUT, $timeout ? $timeout : 45);
-                       //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
+                       curl_setopt($ch, CURLOPT_FOLLOWLOCATION, !ini_get("safe_mode"));
                        curl_setopt($ch, CURLOPT_MAXREDIRS, 20);
                        curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
                        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
index a0c51c97eadff495e151e7db1294be9118061599..9f0b6cb0d8d4717d05244ce407f127f3f6cec68f 100644 (file)
@@ -29,11 +29,16 @@ class Af_Unburn extends Plugin {
 
                        if (strpos($article["plugin_data"], "unburn,$owner_uid:") === FALSE) {
 
-                               $ch = curl_init(geturl($article["link"]));
+                               if (ini_get("safe_mode")) {
+                                       $ch = curl_init(geturl($article["link"]));
+                               } else {
+                                       $ch = curl_init($article["link"]);
+                               }
+
                                curl_setopt($ch, CURLOPT_TIMEOUT, 5);
                                curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
                                curl_setopt($ch, CURLOPT_HEADER, true);
-                               //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
+                               curl_setopt($ch, CURLOPT_FOLLOWLOCATION, !ini_get("safe_mode"));
                                curl_setopt($ch, CURLOPT_USERAGENT, SELF_USER_AGENT);
 
                                $contents = @curl_exec($ch);
@@ -74,7 +79,7 @@ class Af_Unburn extends Plugin {
 
                return $article;
        }
-       
+
                function geturl($url){
 
                (function_exists('curl_init')) ? '' : die('cURL Must be installed for geturl function to work. Ask your host to enable it or uncomment extension=php_curl.dll in php.ini');