Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/wpforms-.../includes/fields
File: class-text.php
[500] Fix | Delete
wpforms()->get( 'process' )->fields[ $field_id ] = [
[501] Fix | Delete
'name' => $name,
[502] Fix | Delete
'value' => $value,
[503] Fix | Delete
'id' => wpforms_validate_field_id( $field_id ),
[504] Fix | Delete
'type' => $this->type,
[505] Fix | Delete
];
[506] Fix | Delete
}
[507] Fix | Delete
[508] Fix | Delete
/**
[509] Fix | Delete
* Validate field on form submit.
[510] Fix | Delete
*
[511] Fix | Delete
* @since 1.6.2
[512] Fix | Delete
*
[513] Fix | Delete
* @param int $field_id Field ID.
[514] Fix | Delete
* @param mixed $field_submit Submitted field value (raw data).
[515] Fix | Delete
* @param array $form_data Form data and settings.
[516] Fix | Delete
*/
[517] Fix | Delete
public function validate( $field_id, $field_submit, $form_data ) {
[518] Fix | Delete
[519] Fix | Delete
parent::validate( $field_id, $field_submit, $form_data );
[520] Fix | Delete
[521] Fix | Delete
if ( empty( $form_data['fields'][ $field_id ] ) || empty( $form_data['fields'][ $field_id ]['limit_enabled'] ) ) {
[522] Fix | Delete
return;
[523] Fix | Delete
}
[524] Fix | Delete
[525] Fix | Delete
$field = $form_data['fields'][ $field_id ];
[526] Fix | Delete
$limit = absint( $field['limit_count'] );
[527] Fix | Delete
$mode = ! empty( $field['limit_mode'] ) ? sanitize_key( $field['limit_mode'] ) : 'characters';
[528] Fix | Delete
$value = sanitize_text_field( $field_submit );
[529] Fix | Delete
[530] Fix | Delete
if ( 'characters' === $mode ) {
[531] Fix | Delete
if ( mb_strlen( str_replace( "\r\n", "\n", $value ) ) > $limit ) {
[532] Fix | Delete
/* translators: %s - limit characters number. */
[533] Fix | Delete
wpforms()->get( 'process' )->errors[ $form_data['id'] ][ $field_id ] = sprintf( _n( 'Text can\'t exceed %d character.', 'Text can\'t exceed %d characters.', $limit, 'wpforms-lite' ), $limit );
[534] Fix | Delete
[535] Fix | Delete
return;
[536] Fix | Delete
}
[537] Fix | Delete
} else {
[538] Fix | Delete
if ( wpforms_count_words( $value ) > $limit ) {
[539] Fix | Delete
/* translators: %s - limit words number. */
[540] Fix | Delete
wpforms()->get( 'process' )->errors[ $form_data['id'] ][ $field_id ] = sprintf( _n( 'Text can\'t exceed %d word.', 'Text can\'t exceed %d words.', $limit, 'wpforms-lite' ), $limit );
[541] Fix | Delete
[542] Fix | Delete
return;
[543] Fix | Delete
}
[544] Fix | Delete
}
[545] Fix | Delete
}
[546] Fix | Delete
}
[547] Fix | Delete
[548] Fix | Delete
new WPForms_Field_Text();
[549] Fix | Delete
[550] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function