diff options
author | irgsmirx <tobias.ramforth@udo.edu> | 2012-12-20 12:01:11 +0100 |
---|---|---|
committer | irgsmirx <tobias.ramforth@udo.edu> | 2012-12-20 12:01:11 +0100 |
commit | 1e3231c73220f667446da8627a747eb4b2fe0c63 (patch) | |
tree | 1326dc17bebb4b954456c61e2ef98396a61f294d /lib/util.php | |
parent | ecf82d22180644504fb2ffad8653394ff72ab6ce (diff) | |
download | nextcloud-server-1e3231c73220f667446da8627a747eb4b2fe0c63.tar.gz nextcloud-server-1e3231c73220f667446da8627a747eb4b2fe0c63.zip |
Update lib/util.php
getUrlContent should take proxy setting into consideration when not using curl, as well
Diffstat (limited to 'lib/util.php')
-rwxr-xr-x | lib/util.php | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/lib/util.php b/lib/util.php index 4170de2125a..98f0d053e32 100755 --- a/lib/util.php +++ b/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); } |