Index: trunk/extensions/Collection/Collection.body.php |
— | — | @@ -1027,7 +1027,12 @@ |
1028 | 1028 | curl_setopt($c, CURLOPT_PROXY, $wgHTTPProxy); |
1029 | 1029 | $userAgent = wfGetAgent(); |
1030 | 1030 | if ( !$userAgent ) $userAgent = "Unknown user agent"; |
1031 | | - curl_setopt( $c, CURLOPT_USERAGENT, $userAgent . " (via " . Http::userAgent() . ", Collection/$wgCollectionVersion)" ); |
| 1031 | + $userAgent .= " (via "; |
| 1032 | + if ( method_exists( Http, 'userAgent' ) ) { |
| 1033 | + $userAgent .= Http::userAgent() . ', '; |
| 1034 | + } |
| 1035 | + $userAgent .= "Collection/$wgCollectionVersion)" |
| 1036 | + curl_setopt( $c, CURLOPT_USERAGENT, $userAgent); |
1032 | 1037 | curl_setopt( $c, CURLOPT_POST, true ); |
1033 | 1038 | curl_setopt( $c, CURLOPT_POSTFIELDS, $postFields ); |
1034 | 1039 | curl_setopt( $c, CURLOPT_HTTPHEADER, array( 'Expect:' ) ); |