Skip to content

Commit

Permalink
Fix file type regex on GraphQL asset mutations
Browse files Browse the repository at this point in the history
Following on from #7327, I modified the regex and ran some tests, and it seems to all be working correctly now.
  • Loading branch information
jamesedmonston committed Dec 23, 2020
1 parent 5dbcd71 commit 6b25b63
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gql/resolvers/mutations/Asset.php
Original file line number Diff line number Diff line change
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 6b25b63

Please sign in to comment.