I tried to insert and SVG image in a template using the template editor and received a 403 (forbidden) message.
Checking the Attachment entry point class, which is used to upload inline images in templates, I noticed that the type "image/svg+xml" is not included in the protected attribute $allowedFileTypes, thus the 403 error.
However the file was uploaded to the data/upload directory and recorded in the db attachment table correctly, although the tag was not saved in the template record (I assume that this was because the 403 error interrupted the process).
Checking the Image entry point class, I saw that it correctly fetches the list of allowed file types from the image metadata file, and there "image/svg+xml" is allowed, so I inserted the svg image into the template using the Image entry point instead.
Is it by design that svg is allowed in the Image entry point but not allowed in the Attachment entry Point or a bug ?.
If this is done purposely, then I think that the forbidden type of file (in this case svg) should not be uploaded when the Attachment entry point is invoked.
In regards to TCPDF, the svg image displays correctly in the template (through the browser) after I inserted it as an image entry point but is not rendered when printed as a PDF
Would this be also a design limitation of TCPDF or a possible bug ?
Thanks
Checking the Attachment entry point class, which is used to upload inline images in templates, I noticed that the type "image/svg+xml" is not included in the protected attribute $allowedFileTypes, thus the 403 error.
However the file was uploaded to the data/upload directory and recorded in the db attachment table correctly, although the tag was not saved in the template record (I assume that this was because the 403 error interrupted the process).
Checking the Image entry point class, I saw that it correctly fetches the list of allowed file types from the image metadata file, and there "image/svg+xml" is allowed, so I inserted the svg image into the template using the Image entry point instead.
Is it by design that svg is allowed in the Image entry point but not allowed in the Attachment entry Point or a bug ?.
If this is done purposely, then I think that the forbidden type of file (in this case svg) should not be uploaded when the Attachment entry point is invoked.
In regards to TCPDF, the svg image displays correctly in the template (through the browser) after I inserted it as an image entry point but is not rendered when printed as a PDF
Would this be also a design limitation of TCPDF or a possible bug ?
Thanks
Comment