mirror of
https://github.com/Intervention/image.git
synced 2025-09-01 18:02:45 +02:00
Bugfix for DataUrl containing newlines inside data
Remove the newlines before doing a Regex check inside the decodeDataUrl method in the same way that is the isBase64 method doing.
This commit is contained in:
@@ -290,7 +290,7 @@ abstract class AbstractDecoder
|
||||
}
|
||||
|
||||
$pattern = "/^data:(?:image\/[a-zA-Z\-\.]+)(?:charset=\".+\")?;base64,(?P<data>.+)$/";
|
||||
preg_match($pattern, $data_url, $matches);
|
||||
preg_match($pattern, str_replace(["\n", "\r"], '', $data_url), $matches);
|
||||
|
||||
if (is_array($matches) && array_key_exists('data', $matches)) {
|
||||
return base64_decode($matches['data']);
|
||||
|
Reference in New Issue
Block a user