Skip to content

Commit

Permalink
Merge pull request #7329 from jamesedmonston/patch-1
Browse files Browse the repository at this point in the history
Fix a bug where file uploading via mutations would not work for some file types.
Resolve #7327
  • Loading branch information
andris-sevcenko committed Jan 4, 2021
2 parents 922e7af + 6b25b63 commit 08644a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gql/resolvers/mutations/Asset.php
Expand Up @@ -177,7 +177,7 @@ protected function handleUpload(AssetElement $asset, array $fileInformation): bo
$dataString = $fileInformation['fileData'];
$fileData = null;

if (preg_match('/^data:((?<type>[a-z0-9]+\/[a-z0-9\+]+);)?base64,(?<data>.+)/i', $dataString, $matches)) {
if (preg_match('/^data:((?<type>[a-z0-9]+\/[a-z0-9\+\.\-]+);)?base64,(?<data>.+)/i', $dataString, $matches)) {
// Decode the file
$fileData = base64_decode($matches['data']);
}
Expand Down

0 comments on commit 08644a6

Please sign in to comment.