Update lib/util.php
getUrlContent should take proxy setting into consideration when not using curl, as well
This commit is contained in:
parent
ecf82d2218
commit
1e3231c732
1 changed files with 21 additions and 8 deletions
29
lib/util.php
29
lib/util.php
|
@ -688,14 +688,27 @@ class OC_Util {
|
|||
curl_close($curl);
|
||||
|
||||
} else {
|
||||
|
||||
$ctx = stream_context_create(
|
||||
array(
|
||||
'http' => array(
|
||||
'timeout' => 10
|
||||
)
|
||||
)
|
||||
);
|
||||
$contextArray = null;
|
||||
|
||||
if(OC_Config::getValue('proxy','')<>'') {
|
||||
$contextArray = array(
|
||||
'http' => array(
|
||||
'timeout' => 10,
|
||||
'proxy' => OC_Config::getValue('proxy')
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$contextArray = array(
|
||||
'http' => array(
|
||||
'timeout' => 10
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
$ctx = stream_context_create(
|
||||
$contextArray
|
||||
);
|
||||
$data=@file_get_contents($url, 0, $ctx);
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue