From 6f5bc8d9a79204b81109bad208d48305cc592e81 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Thu, 10 Jul 2014 23:13:07 +0200 Subject: [PATCH] Setting the user agent to "Mozilla/5.0 (compatible; Friendica)" --- include/network.php | 6 +++--- mod/parse_url.php | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/network.php b/include/network.php index 166f911680..f032e712c8 100644 --- a/include/network.php +++ b/include/network.php @@ -35,7 +35,6 @@ function fetch_url($url,$binary = false, &$redirects = 0, $timeout = 0, $accept_ } @curl_setopt($ch, CURLOPT_RETURNTRANSFER,true); - //@curl_setopt($ch, CURLOPT_USERAGENT, "Friendica"); @curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (compatible; Friendica)"); @@ -135,7 +134,7 @@ function post_url($url,$params, $headers = null, &$redirects = 0, $timeout = 0) curl_setopt($ch, CURLOPT_RETURNTRANSFER,true); curl_setopt($ch, CURLOPT_POST,1); curl_setopt($ch, CURLOPT_POSTFIELDS,$params); - curl_setopt($ch, CURLOPT_USERAGENT, "Friendica"); + curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (compatible; Friendica)"); if(intval($timeout)) { curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); @@ -1164,7 +1163,8 @@ function original_url($url, $depth=1, $fetchbody = false) { curl_setopt($ch, CURLOPT_TIMEOUT, 10); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch,CURLOPT_USERAGENT,'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Firefox/24.0'); + //curl_setopt($ch,CURLOPT_USERAGENT,'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Firefox/24.0'); + curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (compatible; Friendica)"); $header = curl_exec($ch); $curl_info = @curl_getinfo($ch); diff --git a/mod/parse_url.php b/mod/parse_url.php index 481b26533d..7e17b189f8 100644 --- a/mod/parse_url.php +++ b/mod/parse_url.php @@ -66,7 +66,8 @@ function parseurl_getsiteinfo($url, $no_guessing = false, $do_oembed = true) { curl_setopt($ch, CURLOPT_TIMEOUT, 3); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); - curl_setopt($ch,CURLOPT_USERAGENT,' Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Firefox/24.0'); + //curl_setopt($ch,CURLOPT_USERAGENT,' Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Firefox/24.0'); + curl_setopt($ch,CURLOPT_USERAGENT, "Mozilla/5.0 (compatible; Friendica)"); $header = curl_exec($ch); $curl_info = @curl_getinfo($ch); -- 2.39.2