Permalink
Browse files

ExpandURLs plugin: Add cURL user agent to get Facebook redirects, closes

  • Loading branch information...
1 parent 07ecf63 commit f909861070726df792bdbd5ddf735ea1185c7ea5 @ginatrapani ginatrapani committed Mar 22, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 webapp/plugins/expandurls/model/class.URLExpander.php
@@ -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);

0 comments on commit f909861

Please sign in to comment.