From 1e3231c73220f667446da8627a747eb4b2fe0c63 Mon Sep 17 00:00:00 2001
From: irgsmirx <tobias.ramforth@udo.edu>
Date: Thu, 20 Dec 2012 12:01:11 +0100
Subject: [PATCH] Update lib/util.php

getUrlContent should take proxy setting into consideration when not using curl, as well
---
 lib/util.php | 29 +++++++++++++++++++++--------
 1 file changed, 21 insertions(+), 8 deletions(-)

diff --git a/lib/util.php b/lib/util.php
index 4170de2125..98f0d053e3 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);
                 
             }
-- 
GitLab