Merge branch 'MDL-38170-m23' of git://github.com/sammarshallou/moodle into MOODLE_23_...
[moodle.git] / lib / filelib.php
index 49ee9ce..ee2cfc8 100644 (file)
@@ -3009,6 +3009,12 @@ class curl {
         }
         curl_setopt($curl, CURLOPT_HTTPHEADER, $this->header);
 
+        // Bypass proxy (for this request only) if required.
+        if (!empty($this->options['CURLOPT_URL']) &&
+                is_proxybypass($this->options['CURLOPT_URL'])) {
+            unset($this->options['CURLOPT_PROXY']);
+        }
+
         if ($this->debug){
             echo '<h1>Options</h1>';
             var_dump($this->options);