| @@ -1,8 +1,5 @@ | ||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 3 | - die( 'You are not allowed to call this page directly.' ); | |
| 4 | -} | |
| 5 | 2 | |
| 6 | 3 | /** |
| 7 | 4 | * @since 3.0 |
| 8 | 5 | */ |
| @@ -9,9 +6,8 @@ | ||
| 9 | 6 | class FrmFieldText extends FrmFieldType { |
| 10 | 7 | |
| 11 | 8 | /** |
| 12 | 9 | * @var string |
| 13 | - * | |
| 14 | 10 | * @since 3.0 |
| 15 | 11 | */ |
| 16 | 12 | protected $type = 'text'; |
| 17 | 13 | |
| @@ -16,21 +12,12 @@ | ||
| 16 | 12 | protected $type = 'text'; |
| 17 | 13 | |
| 18 | 14 | /** |
| 19 | 15 | * @var bool |
| 20 | - * | |
| 21 | 16 | * @since 3.0 |
| 22 | 17 | */ |
| 23 | 18 | protected $holds_email_values = true; |
| 24 | 19 | |
| 25 | - /** | |
| 26 | - * @var bool | |
| 27 | - */ | |
| 28 | - protected $array_allowed = false; | |
| 29 | - | |
| 30 | - /** | |
| 31 | - * @return bool[] | |
| 32 | - */ | |
| 33 | 20 | protected function field_settings_for_type() { |
| 34 | 21 | return array( |
| 35 | 22 | 'size' => true, |
| 36 | 23 | 'clear_on_focus' => true, |
| @@ -36,20 +23,6 @@ | ||
| 36 | 23 | 'clear_on_focus' => true, |
| 37 | 24 | 'format' => true, |
| 38 | 25 | 'invalid' => true, |
| 39 | 26 | ); |
| 40 | - } | |
| 41 | - | |
| 42 | - /** | |
| 43 | - * @param array $args | |
| 44 | - */ | |
| 45 | - public function validate( $args ) { | |
| 46 | - $errors = parent::validate( $args ); | |
| 47 | - $max_length = intval( FrmField::get_option( $this->field, 'max' ) ); | |
| 48 | - | |
| 49 | - if ( $max_length && FrmAppHelper::mb_function( array( 'mb_strlen', 'strlen' ), array( $args['value'] ) ) > $max_length ) { | |
| 50 | - $errors[ 'field' . $args['id'] ] = FrmFieldsHelper::get_error_msg( $this->field, 'invalid' ); | |
| 51 | - } | |
| 52 | - | |
| 53 | - return $errors; | |
| 54 | 27 | } |
| 55 | 28 | } |