Skip to content

Commit

Permalink
ExpandURLs plugin: Add cURL user agent to get Facebook redirects, closes
Browse files Browse the repository at this point in the history
  • Loading branch information
ginatrapani committed Mar 22, 2012
1 parent 07ecf63 commit f909861
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions webapp/plugins/expandurls/model/class.URLExpander.php
Expand Up @@ -70,6 +70,7 @@ public static function expandURL($tinyurl, $original_link, $current_number, $tot
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0");
$response = curl_exec($ch);
if ($response === false) {
$error_msg = $reconstructed_url." cURL error: ".curl_error($ch);
Expand Down

0 comments on commit f909861

Please sign in to comment.