Skip to content

Commit

Permalink
Handle redundant slashes in ticker config
Browse files Browse the repository at this point in the history
  • Loading branch information
bziemek authored Mar 18, 2018
1 parent 6ff468a commit 8a87239
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion include/classes/tools.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,13 @@ public function getApi($url, $target, $auth=NULL) {
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);
Expand Down

0 comments on commit 8a87239

Please sign in to comment.