summaryrefslogtreecommitdiffstats
path: root/lib/private/util.php
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2014-09-03 22:40:12 +0200
committerLukas Reschke <lukas@owncloud.com>2014-09-03 22:40:12 +0200
commit8fec19a872897404d7aa4d8db9ea70ab850da82d (patch)
tree912c27f80e25e32a2c6b12de9bd0ca532bdfb59a /lib/private/util.php
parent16606f44d73e85a312a8ac96e1035e8bc087dfc5 (diff)
parentc00450b2c715d5928af4ff3f1b8489cd69128c99 (diff)
downloadnextcloud-server-8fec19a872897404d7aa4d8db9ea70ab850da82d.tar.gz
nextcloud-server-8fec19a872897404d7aa4d8db9ea70ab850da82d.zip
Merge pull request #10790 from cbhp/master
added missing User-Agents
Diffstat (limited to 'lib/private/util.php')
-rwxr-xr-xlib/private/util.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/private/util.php b/lib/private/util.php
index 94508e502e4..2a0f9197e3c 100755
--- a/lib/private/util.php
+++ b/lib/private/util.php
@@ -5,6 +5,8 @@
*
*/
class OC_Util {
+ const USER_AGENT = 'ownCloud Server Crawler';
+
public static $scripts = array();
public static $styles = array();
public static $headers = array();
@@ -1247,7 +1249,7 @@ class OC_Util {
curl_setopt($curl, CURLOPT_URL, $url);
- curl_setopt($curl, CURLOPT_USERAGENT, "ownCloud Server Crawler");
+ curl_setopt($curl, CURLOPT_USERAGENT, self::USER_AGENT);
if (OC_Config::getValue('proxy', '') != '') {
curl_setopt($curl, CURLOPT_PROXY, OC_Config::getValue('proxy'));
}
@@ -1269,6 +1271,7 @@ class OC_Util {
curl_setopt($rcurl, CURLOPT_NOBODY, true);
curl_setopt($rcurl, CURLOPT_FORBID_REUSE, false);
curl_setopt($rcurl, CURLOPT_RETURNTRANSFER, true);
+ curl_setopt($rcurl, CURLOPT_USERAGENT, self::USER_AGENT);
do {
curl_setopt($rcurl, CURLOPT_URL, $newURL);
$header = curl_exec($rcurl);
@@ -1303,6 +1306,7 @@ class OC_Util {
if (OC_Config::getValue('proxy', '') != '') {
$contextArray = array(
'http' => array(
+ 'header' => 'User-Agent: ' . self::USER_AGENT . "\r\n",
'timeout' => 10,
'proxy' => OC_Config::getValue('proxy')
)
@@ -1310,6 +1314,7 @@ class OC_Util {
} else {
$contextArray = array(
'http' => array(
+ 'header' => 'User-Agent: ' . self::USER_AGENT . "\r\n",
'timeout' => 10
)
);