: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
namespace Contactable\SWV;
class MinFileSizeRule extends Rule {
const rule_name = 'minfilesize';
public function matches( $context ) {
if ( false === parent::matches( $context ) ) {
if ( empty( $context['file'] ) ) {
public function validate( $context ) {
$field = $this->get_property( 'field' );
$input = $_FILES[$field]['size'] ?? '';
$input = wpcf7_array_flatten( $input );
$input = wpcf7_exclude_blank( $input );
$threshold = $this->get_property( 'threshold' );
if ( array_sum( $input ) < $threshold ) {
return $this->create_error();