mirror of
https://github.com/Intervention/image.git
synced 2025-08-14 01:44:03 +02:00
fixed bug with very long data url
This commit is contained in:
@@ -204,7 +204,7 @@ abstract class AbstractDecoder
|
|||||||
*/
|
*/
|
||||||
private function decodeDataUrl($data_url)
|
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);
|
preg_match($pattern, $data_url, $matches);
|
||||||
|
|
||||||
if (is_array($matches) && array_key_exists('data', $matches)) {
|
if (is_array($matches) && array_key_exists('data', $matches)) {
|
||||||
|
Reference in New Issue
Block a user