PATH:
home
/
lab2454c
/
caimegroup.com
/
wp-content
/
plugins
/
contact-form-7
/
includes
/
swv
/
php
/
rules
<?php namespace Contactable\SWV; class MinLengthRule extends Rule { const rule_name = 'minlength'; public function matches( $context ) { if ( false === parent::matches( $context ) ) { return false; } if ( empty( $context['text'] ) ) { return false; } return true; } public function validate( $context ) { $input = $this->get_default_input(); $input = wpcf7_array_flatten( $input ); $input = wpcf7_exclude_blank( $input ); if ( empty( $input ) ) { return true; } $total = 0; foreach ( $input as $i ) { $total += wpcf7_count_code_units( $i ); } $threshold = (int) $this->get_property( 'threshold' ); if ( $threshold <= $total ) { return true; } else { return $this->create_error(); } } }
[-] any.php
[edit]
[-] mindate.php
[edit]
[-] minitems.php
[edit]
[+]
..
[-] email.php
[edit]
[-] required.php
[edit]
[-] maxitems.php
[edit]
[-] minlength.php
[edit]
[-] dayofweek.php
[edit]
[-] number.php
[edit]
[-] maxlength.php
[edit]
[-] url.php
[edit]
[-] maxdate.php
[edit]
[-] enum.php
[edit]
[-] file.php
[edit]
[-] minfilesize.php
[edit]
[-] all.php
[edit]
[-] time.php
[edit]
[-] maxfilesize.php
[edit]
[-] minnumber.php
[edit]
[-] maxnumber.php
[edit]
[-] date.php
[edit]
[-] tel.php
[edit]
[-] error_log
[edit]
[-] requiredfile.php
[edit]