X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=inc%2Fpoche%2FTools.class.php;h=750553f1202637eeb4886a569c2586604530d547;hb=2ab37d6205d3e4f7bfacf702de6755a924931751;hp=1d092823fd1cad93b6c342676656ae5abe36e111;hpb=5e07dc8b51f9612de5f5a00bbac399c777e82fa4;p=github%2Fwallabag%2Fwallabag.git 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 $scriptname = str_replace('/index.php', '/', $_SERVER["SCRIPT_NAME"]); - if (!isset($_SERVER["SERVER_NAME"])) { + if (!isset($_SERVER["HTTP_HOST"])) { return $scriptname; } return 'http' . ($https ? 's' : '') . '://' - . $_SERVER["SERVER_NAME"] . $serverport . $scriptname; + . $_SERVER["HTTP_HOST"] . $serverport . $scriptname; } public static function redirect($url = '') @@ -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);