]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
[fix] bug fix #287: test if open_basedir & safe_mode are active to use CURLOPT_FOLLOW...
authorNicolas Lœuillet <nicolas.loeuillet@gmail.com>
Wed, 13 Nov 2013 14:17:34 +0000 (15:17 +0100)
committerNicolas Lœuillet <nicolas.loeuillet@gmail.com>
Wed, 13 Nov 2013 14:17:34 +0000 (15:17 +0100)
inc/poche/Tools.class.php

index 1d092823fd1cad93b6c342676656ae5abe36e111..7a872e7dff40e47951d222dd2994fa12590d3a9b 100644 (file)
@@ -133,7 +133,9 @@ class Tools
             $curl = curl_init();
             curl_setopt($curl, CURLOPT_URL, $url);
             curl_setopt($curl, CURLOPT_TIMEOUT, $timeout);
-            curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
+            if (!ini_get('open_basedir') && !ini_get('safe_mode')) {
+                curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
+            }
             curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
             curl_setopt($curl, CURLOPT_HEADER, false);