diff options
author | Kevin Turner <kevin@janrain.com> | 2008-05-31 01:04:07 +0000 |
---|---|---|
committer | Kevin Turner <kevin@janrain.com> | 2008-05-31 01:04:07 +0000 |
commit | 79b253e3194290da046b7980f5054e8a2694229e (patch) | |
tree | 6290ab13e96a3af2d6341da2793e1810c998fd64 /Auth | |
parent | 749a7d663d4a1e18864df4c78e3dc500f9a7f87f (diff) | |
download | php-openid-79b253e3194290da046b7980f5054e8a2694229e.zip php-openid-79b253e3194290da046b7980f5054e8a2694229e.tar.gz php-openid-79b253e3194290da046b7980f5054e8a2694229e.tar.bz2 |
[project @ ParanoidHTTPFetcher: check to see if curl_version returns an array or not.]
Diffstat (limited to 'Auth')
-rw-r--r-- | Auth/Yadis/HTTPFetcher.php | 2 | ||||
-rw-r--r-- | Auth/Yadis/ParanoidHTTPFetcher.php | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/Auth/Yadis/HTTPFetcher.php b/Auth/Yadis/HTTPFetcher.php index 8cb4b23..a182540 100644 --- a/Auth/Yadis/HTTPFetcher.php +++ b/Auth/Yadis/HTTPFetcher.php @@ -20,7 +20,7 @@ require_once "Auth/OpenID.php"; define('Auth_OpenID_FETCHER_MAX_RESPONSE_KB', 1024); define('Auth_OpenID_USER_AGENT', - 'php-openid/'.Auth_OpenID_VERSION.' php '.phpversion()); + 'php-openid/'.Auth_OpenID_VERSION.' (php/'.phpversion().')'); class Auth_Yadis_HTTPResponse { function Auth_Yadis_HTTPResponse($final_url = null, $status = null, diff --git a/Auth/Yadis/ParanoidHTTPFetcher.php b/Auth/Yadis/ParanoidHTTPFetcher.php index bbbef8e..8f312a1 100644 --- a/Auth/Yadis/ParanoidHTTPFetcher.php +++ b/Auth/Yadis/ParanoidHTTPFetcher.php @@ -118,8 +118,13 @@ class Auth_Yadis_ParanoidHTTPFetcher extends Auth_Yadis_HTTPFetcher { } $cv = curl_version(); + if(is_array($cv)) { + $curl_user_agent = 'curl/'.$cv['version']; + } else { + $curl_user_agent = $cv; + } curl_setopt($c, CURLOPT_USERAGENT, - Auth_OpenID_USER_AGENT.' curl '.$cv['version']); + Auth_OpenID_USER_AGENT.' '.$curl_user_agent); curl_setopt($c, CURLOPT_TIMEOUT, $off); curl_setopt($c, CURLOPT_URL, $url); curl_setopt($c, CURLOPT_RANGE, |