Skip to content

Commit

Permalink
Attempting to fix CURLRequest debug issue. #1994
Browse files Browse the repository at this point in the history
  • Loading branch information
lonnieezell committed May 10, 2019
1 parent e218238 commit aa362d0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion system/HTTP/CURLRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ protected function setCURLOptions(array $curl_options = [], array $config = [])
if (isset($config['debug']))
{
$curl_options[CURLOPT_VERBOSE] = $config['debug'] === true ? 1 : 0;
$curl_options[CURLOPT_STDERR] = is_bool($config['debug']) ? fopen('php://output', 'w+') : $config['debug'];
$curl_options[CURLOPT_STDERR] = $config['debug'] === true ? fopen('php://output', 'w+') : $config['debug'];
}

// Decode Content
Expand Down
9 changes: 9 additions & 0 deletions tests/system/HTTP/CURLRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,15 @@ public function testDebugOption()
$this->assertEquals(1, $options[CURLOPT_VERBOSE]);

$this->assertArrayHasKey(CURLOPT_STDERR, $options);
$this->assertTrue(is_resource($options[CURLOPT_STDERR]));

$this->request->request('get', 'http://example.com', [
'debug' => false,
]);

$options = $this->request->curl_options;

$this->assertFalse($options[CURLOPT_STDERR]);
}

//--------------------------------------------------------------------
Expand Down

0 comments on commit aa362d0

Please sign in to comment.