diff --git a/include/classes/tools.class.php b/include/classes/tools.class.php index f0eb8694..029b8cb4 100644 --- a/include/classes/tools.class.php +++ b/include/classes/tools.class.php @@ -44,9 +44,13 @@ class Tools extends Base { curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; PHP client; '.php_uname('s').'; PHP/'.phpversion().')'); } - curl_setopt($ch, CURLOPT_URL, $url . $target); + + $url = rtrim($url, '/'); + $target = ltrim($target, '/'); + curl_setopt($ch, CURLOPT_URL, $url . '/' . $target); // curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);