Skip to content
Permalink
Browse files

Add "proxy_settings" when using curl see BT#14260

  • Loading branch information...
jmontoyaa committed Apr 23, 2018
1 parent 97d5df2 commit 6b28ec89efa2b71a167d754da6fb40f2c89c2d70
Showing with 10 additions and 1 deletion.
  1. +10 −1 main/lp/learnpath.class.php
@@ -12312,6 +12312,7 @@ public function getCalculateScore($sessionId = 0)
public function fixBlockedLinks($src)
{
$urlInfo = parse_url($src);
$platformProtocol = 'https';
if (strpos(api_get_path(WEB_CODE_PATH), 'https') === false) {
$platformProtocol = 'http';
@@ -12332,7 +12333,6 @@ public function fixBlockedLinks($src)
if (strpos(api_get_path(WEB_PATH), $host) === false) {
// Check X-Frame-Options
$ch = curl_init();
$options = [
CURLOPT_URL => $src,
CURLOPT_RETURNTRANSFER => true,
@@ -12344,6 +12344,15 @@ public function fixBlockedLinks($src)
CURLOPT_TIMEOUT => 120,
CURLOPT_MAXREDIRS => 10,
];
$proxySettings = api_get_configuration_value('proxy_settings');
if (!empty($proxySettings) &&
isset($proxySettings['curl_setopt_array'])
) {
$options[CURLOPT_PROXY] = $proxySettings['curl_setopt_array']['CURLOPT_PROXY'];
$options[CURLOPT_PROXYPORT] = $proxySettings['curl_setopt_array']['CURLOPT_PROXYPORT'];
}
curl_setopt_array($ch, $options);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch);

0 comments on commit 6b28ec8

Please sign in to comment.
You can’t perform that action at this time.