From 39af8d650da0854d51eca6dc09c700806a40897d Mon Sep 17 00:00:00 2001 From: nixpanel Date: Sat, 4 Jul 2026 07:46:56 -0500 Subject: [PATCH] Implement Settings > Media's "Allow SVG uploads" toggle (v2.3.0) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The toggle existed in the UI with no implementation behind it, so uploads were rejected regardless of the setting. New SvgUploads class: - Allowlists the SVG mime type and fixes WP's real-mime sniff, which otherwise nulls out the file type for SVGs specifically even after the mime allowlist is updated. - Populates width/height metadata (parsed from the SVG's own viewBox/width/height) — without this, wp_get_missing_image_subsizes() throws undefined-array-key warnings that can corrupt the upload response's JSON on environments with warnings displayed inline. - Basic sanitization on upload (strips