1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-13 09:24:05 +02:00

fixed bug with very long data url

This commit is contained in:
Oliver Vogel
2014-12-11 18:52:04 +01:00
parent f9bd6c102b
commit ab3b4750da

View File

@@ -204,7 +204,7 @@ abstract class AbstractDecoder
*/
private function decodeDataUrl($data_url)
{
$pattern = "/^data:(?:image\/.+)(?:charset=\".+\")?;base64,(?P<data>.+)$/";
$pattern = "/^data:(?:image\/[a-zA-Z\-\.]+)(?:charset=\".+\")?;base64,(?P<data>.+)$/";
preg_match($pattern, $data_url, $matches);
if (is_array($matches) && array_key_exists('data', $matches)) {