Skip to content

Commit

Permalink
Avoid errors with undefined variables
Browse files Browse the repository at this point in the history
  • Loading branch information
jonhoo committed Feb 6, 2014
1 parent 922e4b3 commit 46532e4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/curl_http_client.php
Expand Up @@ -527,11 +527,11 @@ function curl_exec_redir($ch)
return $data;
}
$last_url = parse_url(curl_getinfo($ch, CURLINFO_EFFECTIVE_URL));
if (!$url['scheme'])
if (empty($url['scheme']))
$url['scheme'] = $last_url['scheme'];
if (!$url['host'])
if (empty($url['host']))
$url['host'] = $last_url['host'];
if (!$url['path'])
if (empty($url['path']))
$url['path'] = $last_url['path'];
$new_url = $url['scheme'] . '://' . $url['host'] . $url['path'] . (!empty($url['query'])?'?'.$url['query']:'');
//echo "Being redirected to $new_url\n";
Expand Down

0 comments on commit 46532e4

Please sign in to comment.