Skip to content

Commit

Permalink
Bugfix: Correctly strip base64 prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
ceesvanegmond committed Oct 9, 2017
1 parent f80c62a commit a1177ef
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 a1177ef

Please sign in to comment.