mirror of
https://github.com/tecnickcom/TCPDF.git
synced 2025-04-20 05:51:58 +02:00
improve SVG detection by checking for (mandatory) namespace and closing tag
This commit is contained in:
parent
cfbc0028cc
commit
122a2c61dc
@ -19055,7 +19055,7 @@ class TCPDF {
|
||||
if ($imgsrc[0] === '@') {
|
||||
// data stream
|
||||
$imgsrc = '@'.base64_decode(substr($imgsrc, 1));
|
||||
$type = preg_match('/<svg([^\>]*)>/si', $imgsrc) ? 'svg' : '';
|
||||
$type = preg_match('/<svg\s+[^>]*\bxmlns\s*=\s*"http:\/\/www\.w3\.org\/2000\/svg"[^>]*>.*<\/svg>/is', $imgsrc) ? 'svg' : '';
|
||||
} else if (preg_match('@^data:image/([^;]*);base64,(.*)@', $imgsrc, $reg)) {
|
||||
$imgsrc = '@'.base64_decode($reg[2]);
|
||||
$type = $reg[1];
|
||||
|
Loading…
x
Reference in New Issue
Block a user