Permalink
Browse files

fix: failed to close file stream in onedrive policy

  • Loading branch information...
HFO4 committed Sep 13, 2018
1 parent 55ea76e commit 78f4a1eae9358cf99938cac8d36136abef2da728
Showing with 3 additions and 1 deletion.
  1. +3 −1 extend/Krizalys/Onedrive/Client.php
@@ -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,
@@ -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;

0 comments on commit 78f4a1e

Please sign in to comment.