Skip to content

Commit

Permalink
Merge pull request #36 from ceesvanegmond/patch-3
Browse files Browse the repository at this point in the history
Bugfix: Correctly strip base64 prefix
  • Loading branch information
J-Ben87 authored Oct 9, 2017
2 parents f80c62a + a1177ef commit 5103371
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Form/DataTransformer/Base64ToImageTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public function reverseTransform($value)
return null;
}


$base64 = preg_replace('/data:.*;base64,/', '', $value['base64']);
$prefixLenght = strpos($value['base64'], 'base64,') + 7;
$base64 = substr($value['base64'], $prefixLenght);

$filePath = tempnam(sys_get_temp_dir(), 'UploadedFile');
$file = fopen($filePath, 'w');
Expand Down

0 comments on commit 5103371

Please sign in to comment.