Skip to content

Commit

Permalink
fix for php bug on some version
Browse files Browse the repository at this point in the history
  • Loading branch information
liverbool authored Jan 18, 2019
1 parent 7b77d3d commit 4372ba0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Util/Base64ToFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ class Base64ToFile
*/
public static function createFileInfo(string $base64String): \SplFileInfo
{
preg_match('/data:(.*);/', $base64String, $matchMime);
preg_match('/data:image\/(.*);base64/', $base64String, $matchExt);
preg_match('|data:(.*);|', $base64String, $matchMime);
preg_match('|data:image/([a-zA-Z0-9]+);base64|', $base64String, $matchExt);

$fileName = sprintf('/%s.%s', uniqid(), $matchExt[1]);
$outputFile = sys_get_temp_dir() . $fileName;
Expand Down

0 comments on commit 4372ba0

Please # to comment.