You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SVGs must have the doctype defined in the first line to be correctly identified as an SVG file by Wordpress - <?xml version="1.0" encoding="utf-8"?>
SVG cleaners like ImageOptim and SVGO - which we should encourage the use of - will often remove the <?xml ?> declaration
There's no safe technical solution to this issue. Automatically adding the declaration via PHP could lead to unsafe SVGs being allowed by default
Solution
When SVG is detected as the file extension, adjust the Sorry, this file type is not permitted for security reasons. message to include a hint about adding the XML declaration as the first line
Change message to: Sorry, this file type is not permitted for security reasons.<br>SVGs require the following line at the start of the file to be valid. Ensure this is the case with the uploaded file.<br><pre><?xml version="1.0" encoding="utf-8"?></pre>
The text was updated successfully, but these errors were encountered:
Problem
<?xml version="1.0" encoding="utf-8"?>
<?xml ?>
declarationSolution
Sorry, this file type is not permitted for security reasons.
message to include a hint about adding the XML declaration as the first lineNotes
Sorry, this file type is not permitted for security reasons.<br>SVGs require the following line at the start of the file to be valid. Ensure this is the case with the uploaded file.<br><pre><?xml version="1.0" encoding="utf-8"?></pre>
The text was updated successfully, but these errors were encountered: