diff options
author | Nicolas LÅ“uillet <nicolas.loeuillet@gmail.com> | 2013-11-25 02:00:07 -0800 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas.loeuillet@gmail.com> | 2013-11-25 02:00:07 -0800 |
commit | c2b7a11c772a5b503896add11ea18838999f8d58 (patch) | |
tree | 1976b248eb85e335febc13e0442b8fe766b91687 /inc/poche/Tools.class.php | |
parent | cd8a3441561fa63b9da1b705c4b28dee787f79b0 (diff) | |
parent | 7a4482b8a43afca7f5c311ae7e44b3f0c4d239c0 (diff) | |
download | wallabag-c2b7a11c772a5b503896add11ea18838999f8d58.tar.gz wallabag-c2b7a11c772a5b503896add11ea18838999f8d58.tar.zst wallabag-c2b7a11c772a5b503896add11ea18838999f8d58.zip |
Merge pull request #326 from inthepoche/dev
1.2.0
Diffstat (limited to 'inc/poche/Tools.class.php')
-rw-r--r-- | inc/poche/Tools.class.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index 1d092823..750553f1 100644 --- a/inc/poche/Tools.class.php +++ b/inc/poche/Tools.class.php | |||
@@ -53,12 +53,12 @@ class Tools | |||
53 | 53 | ||
54 | $scriptname = str_replace('/index.php', '/', $_SERVER["SCRIPT_NAME"]); | 54 | $scriptname = str_replace('/index.php', '/', $_SERVER["SCRIPT_NAME"]); |
55 | 55 | ||
56 | if (!isset($_SERVER["SERVER_NAME"])) { | 56 | if (!isset($_SERVER["HTTP_HOST"])) { |
57 | return $scriptname; | 57 | return $scriptname; |
58 | } | 58 | } |
59 | 59 | ||
60 | return 'http' . ($https ? 's' : '') . '://' | 60 | return 'http' . ($https ? 's' : '') . '://' |
61 | . $_SERVER["SERVER_NAME"] . $serverport . $scriptname; | 61 | . $_SERVER["HTTP_HOST"] . $serverport . $scriptname; |
62 | } | 62 | } |
63 | 63 | ||
64 | public static function redirect($url = '') | 64 | public static function redirect($url = '') |
@@ -133,7 +133,9 @@ class Tools | |||
133 | $curl = curl_init(); | 133 | $curl = curl_init(); |
134 | curl_setopt($curl, CURLOPT_URL, $url); | 134 | curl_setopt($curl, CURLOPT_URL, $url); |
135 | curl_setopt($curl, CURLOPT_TIMEOUT, $timeout); | 135 | curl_setopt($curl, CURLOPT_TIMEOUT, $timeout); |
136 | curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); | 136 | if (!ini_get('open_basedir') && !ini_get('safe_mode')) { |
137 | curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); | ||
138 | } | ||
137 | curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); | 139 | curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); |
138 | curl_setopt($curl, CURLOPT_HEADER, false); | 140 | curl_setopt($curl, CURLOPT_HEADER, false); |
139 | 141 | ||