From 2e561d1a66ef9a293e8cf32fb2cccdbde8bd9a87 Mon Sep 17 00:00:00 2001 From: rbruhn Date: Sun, 6 Oct 2024 11:06:41 -0400 Subject: [PATCH] Add if statement to change $data to string so it can be returned as RawContent. Fixes #19 --- src/Storage/File/StorableFileFactory.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Storage/File/StorableFileFactory.php b/src/Storage/File/StorableFileFactory.php index 241d075..496373d 100644 --- a/src/Storage/File/StorableFileFactory.php +++ b/src/Storage/File/StorableFileFactory.php @@ -98,6 +98,10 @@ public function makeFromAny($data, ?string $name = null, ?string $mimeType = nul return $this->makeFromFileInfo($data, $name, $mimeType); } + // Convert data to string to be so it can be interpreted. + if (! is_string($data)){ + $data = serialize($data); + } // Fallback: expect raw or string data, and attempt to interpret it. if (is_string($data)) {