Uploads and limitseasy_svg_upload_bits_check()

easy_svg_upload_bits_check()

Refuses SVG bytes written through wp_upload_bits() unless they are already clean.

Function · Easy SVG · Status: Internal · Defined in easy-svg.php

Internal: not part of the promised public surface. It may change without notice.

Usage

easy_svg_upload_bits_check( array $upload ): array|string

Example

remove_filter( 'wp_upload_bits', 'easy_svg_upload_bits_check' );

Description

Hooked on wp_upload_bits while SVG uploads are on. That filter cannot replace bytes, so an SVG passes only when easy_svg_markup_is_clean() says the sanitizer would change nothing. Empty bits pass, because importers reserve a file that way; the attachment safety net checks the finished file. A refusal returns a translated message string.

Parameters

body
$uploadarray

name, bits and time.

Return value

returnarray|string

The upload unchanged, or an error message.