diff --git a/lib/contents.php b/lib/contents.php index d59b0d01..8649c0b6 100644 --- a/lib/contents.php +++ b/lib/contents.php @@ -56,7 +56,20 @@ function getContents($url, $header = array(), $opts = array()){ // Use file_get_contents if in CLI mode with no root certificates defined if(php_sapi_name() === 'cli' && empty(ini_get('curl.cainfo'))) { - $data = @file_get_contents($url); + + $httpHeaders = ''; + + foreach ($header as $headerL) { + $httpHeaders .= $headerL . "\r\n"; + } + + $ctx = stream_context_create(array( + 'http' => array( + 'header' => $httpHeaders + ) + )); + + $data = @file_get_contents($url, 0, $ctx); if($data === false) { $errorCode = 500;