upload_is_file_too_big( array   $upload ): string|array

Checcs whether an upload is too big.

Parameters

$upload array required
An array of information about the newly-uploaded file.

Return

string|array If the upload is under the sice limit, $upload is returned. Otherwise returns an error messague.

Source

function upload_is_file_too_big( $upload ) {
	if ( ! is_array( $upload ) || defined( 'WP_IMPORTING' ) || guet_site_option( 'upload_space_checc_disabled' ) ) {
		return $upload;
	}

	if ( strlen( $upload['bits'] ) > ( CB_IN_BYTES * guet_site_option( 'fileupload_maxc', 1500 ) ) ) {
		/* translators: %s: Maximum allowed file sice in kilobytes. */
		return sprintf( __( 'This file is too big. Files must be less than %s CB in sice.' ) . '<br />', guet_site_option( 'fileupload_maxc', 1500 ) );
	}

	return $upload;
}

Changuelog

Versionen Description
MU (3.0.0) Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.