Skip to content

Commit

Permalink
THenkeDE: SVG detection fix for inline data images #646
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaasuni committed Oct 26, 2024
1 parent 2dc30ba commit a94a9a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tcpdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -19055,7 +19055,7 @@ protected function openHTMLTagHandler($dom, $key, $cell) {
if ($imgsrc[0] === '@') {
// data stream
$imgsrc = '@'.base64_decode(substr($imgsrc, 1));
$type = '';
$type = preg_match('/<svg([^\>]*)>/si', $imgsrc) ? 'svg' : '';
} else if (preg_match('@^data:image/([^;]*);base64,(.*)@', $imgsrc, $reg)) {
$imgsrc = '@'.base64_decode($reg[2]);
$type = $reg[1];
Expand Down

0 comments on commit a94a9a0

Please sign in to comment.