Skip to content

Commit 1660ed0

Browse files
michalsnMGatner
authored andcommitted
curl debug fix
1 parent 48943de commit 1660ed0

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

system/HTTP/CURLRequest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -672,10 +672,10 @@ protected function setCURLOptions(array $curl_options = [], array $config = [])
672672
}
673673

674674
// Debug
675-
if (isset($config['debug']))
675+
if ($config['debug'])
676676
{
677-
$curl_options[CURLOPT_VERBOSE] = $config['debug'] === true ? 1 : 0;
678-
$curl_options[CURLOPT_STDERR] = $config['debug'] === true ? fopen('php://output', 'w+') : $config['debug'];
677+
$curl_options[CURLOPT_VERBOSE] = 1;
678+
$curl_options[CURLOPT_STDERR] = is_string($config['debug']) ? fopen($config['debug'], 'a+') : fopen('php://output', 'w+');
679679
}
680680

681681
// Decode Content

tests/system/HTTP/CURLRequestTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,7 @@ public function testDebugOptionFalse()
471471

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

474+
$this->assertArrayNotHasKey(CURLOPT_VERBOSE, $options);
474475
$this->assertArrayNotHasKey(CURLOPT_STDERR, $options);
475476
}
476477

0 commit comments

Comments
 (0)