Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVG Filetype detection #645

Open
THenkeDE opened this issue Sep 11, 2023 · 5 comments
Open

SVG Filetype detection #645

THenkeDE opened this issue Sep 11, 2023 · 5 comments

Comments

@THenkeDE
Copy link

No description provided.

@THenkeDE
Copy link
Author

even in the latest 6.6.5 the detection of inline SVG seems broken.

Chainging Line 19016 of tcpdf.php

from
$type = '';

to
$type = preg_match('/<svg([^\>]*)>/si', $imgsrc) ? 'svg' : ''

seems to fix this.

@williamdes
Copy link
Contributor

Can you open a pull-request for that?

@THenkeDE
Copy link
Author

@williamdes did so just right now

@mcapinha-mxp
Copy link
Contributor

mcapinha-mxp commented Nov 25, 2024

Hi all.
This change is triggering false positives for me. It happened in more than one occasion, so I downgraded to 6.7.6 and all was good.

Now that I found some time to debug this and I can trace it here (line 19206):
https://github.com/tecnickcom/TCPDF/pull/646/files#diff-9e49843a3fbb8d051466b9db0da16467ce405ebff7855afaa854ea9d680b38d6R19026

The error coming from TCPDF is SVG Error: Not well-formed (invalid token) at line 1 , which makes sense as the inline'd file is actually a JPG.

I can't share the JPG as it contains personal data, but this is what it looks like when cat'ed from the command line.

image

Not sure what's the best path to ask that this change is reverted (@nicolaasuni , maybe ?), so please advise.

@mcapinha-mxp
Copy link
Contributor

I added a PR here: #765
Please let me know if any changes are required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants