Skip to content

Commit

Permalink
fix: failed to close file stream in onedrive policy
Browse files Browse the repository at this point in the history
  • Loading branch information
HFO4 committed Sep 13, 2018
1 parent 55ea76e commit 78f4a1e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion extend/Krizalys/Onedrive/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,9 @@ public function apiPut($path, $stream, $contentType = null)

public function sendFileChunk($url,$headers,$stream){
$curl = self::_createCurl("");
$close = 0;
if(!is_resource($stream)){
$close = 1;
$options=[];
$options = array_merge([
'stream_back_end' => $this->_streamBackEnd,
Expand Down Expand Up @@ -629,7 +631,7 @@ public function sendFileChunk($url,$headers,$stream){
curl_setopt_array($curl, $options);

$data = $this->_processResult($curl);
if (!is_resource($content)) {
if (is_resource($close)) {
fclose($stream);
}
return $data;
Expand Down

0 comments on commit 78f4a1e

Please sign in to comment.