Skip to content

Commit f0de682

Browse files
Merge pull request #22 from Alanaktion/fix-stream-feeds
Fix handling of streams in feed uploads
2 parents 083516b + 809aca5 commit f0de682

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/Helper/Feeder.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@ public function uploadFeedDocument($payload, $contentType, $feedContentFilePath)
3434
$key = base64_decode($key, true);
3535

3636
// get file to upload
37-
$file = file_get_contents($feedContentFilePath);
38-
$fileResourceType = gettype($file);
37+
$fileResourceType = gettype($feedContentFilePath);
3938

4039
// resource or string ? make it to a string
4140
if ($fileResourceType == 'resource') {
42-
$file = stream_get_contents($file);
41+
$file = stream_get_contents($feedContentFilePath);
42+
} else {
43+
$file = file_get_contents($feedContentFilePath);
4344
}
4445

4546
// utf8 !
@@ -98,4 +99,4 @@ public function downloadFeedProcessingReport($payload)
9899
$json = json_encode($xml);
99100
return json_decode($json, TRUE);
100101
}
101-
}
102+
}

0 commit comments

Comments
 (0)