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/wp-conte.../plugins/wpforms-.../src/Admin/Tools/Importer...
File: ContactForm7.php
}
[500] Fix | Delete
[501] Fix | Delete
if ( $type === 'placeholder' ) {
[502] Fix | Delete
return $placeholder;
[503] Fix | Delete
}
[504] Fix | Delete
[505] Fix | Delete
return $default_value;
[506] Fix | Delete
}
[507] Fix | Delete
[508] Fix | Delete
/**
[509] Fix | Delete
* Get the field label.
[510] Fix | Delete
*
[511] Fix | Delete
* @since 1.6.6
[512] Fix | Delete
*
[513] Fix | Delete
* @param string $form Form data and settings.
[514] Fix | Delete
* @param string $type Field type.
[515] Fix | Delete
* @param string $name Field name.
[516] Fix | Delete
*
[517] Fix | Delete
* @return string
[518] Fix | Delete
*/
[519] Fix | Delete
public function get_field_label( $form, $type, $name = '' ) {
[520] Fix | Delete
[521] Fix | Delete
preg_match_all( '/<label>([ \w\S\r\n\t]+?)<\/label>/', $form, $matches );
[522] Fix | Delete
[523] Fix | Delete
foreach ( $matches[1] as $match ) {
[524] Fix | Delete
$match = trim( str_replace( "\n", '', $match ) );
[525] Fix | Delete
[526] Fix | Delete
preg_match( '/\[(?:' . preg_quote( $type ) . ') ' . $name . '(?:[ ](.*?))?(?:[\r\n\t ](\/))?\]/', $match, $input_match );
[527] Fix | Delete
[528] Fix | Delete
if ( ! empty( $input_match[0] ) ) {
[529] Fix | Delete
return strip_shortcodes( sanitize_text_field( str_replace( $input_match[0], '', $match ) ) );
[530] Fix | Delete
}
[531] Fix | Delete
}
[532] Fix | Delete
[533] Fix | Delete
$label = sprintf( /* translators: %1$s - field type, %2$s - field name if available. */
[534] Fix | Delete
esc_html__( '%1$s Field %2$s', 'wpforms-lite' ),
[535] Fix | Delete
ucfirst( $type ),
[536] Fix | Delete
! empty( $name ) ? "($name)" : ''
[537] Fix | Delete
);
[538] Fix | Delete
[539] Fix | Delete
return trim( $label );
[540] Fix | Delete
}
[541] Fix | Delete
[542] Fix | Delete
/**
[543] Fix | Delete
* Replace 3rd-party form provider tags/shortcodes with our own Smart Tags.
[544] Fix | Delete
*
[545] Fix | Delete
* @since 1.6.6
[546] Fix | Delete
*
[547] Fix | Delete
* @param string $string Text to look for Smart Tags in.
[548] Fix | Delete
* @param array $fields List of fields to process Smart Tags in.
[549] Fix | Delete
*
[550] Fix | Delete
* @return string
[551] Fix | Delete
*/
[552] Fix | Delete
public function get_smarttags( $string, $fields ) {
[553] Fix | Delete
[554] Fix | Delete
preg_match_all( '/\[(.+?)\]/', $string, $tags );
[555] Fix | Delete
[556] Fix | Delete
if ( empty( $tags[1] ) ) {
[557] Fix | Delete
return $string;
[558] Fix | Delete
}
[559] Fix | Delete
[560] Fix | Delete
// Process form-tags and mail-tags.
[561] Fix | Delete
foreach ( $tags[1] as $tag ) {
[562] Fix | Delete
foreach ( $fields as $field ) {
[563] Fix | Delete
if ( ! empty( $field['cf7_name'] ) && $field['cf7_name'] === $tag ) {
[564] Fix | Delete
$string = str_replace( '[' . $tag . ']', '{field_id="' . $field['id'] . '"}', $string );
[565] Fix | Delete
}
[566] Fix | Delete
}
[567] Fix | Delete
}
[568] Fix | Delete
[569] Fix | Delete
// Process CF7 tags that we can map with WPForms alternatives.
[570] Fix | Delete
$string = str_replace(
[571] Fix | Delete
[
[572] Fix | Delete
'[_remote_ip]',
[573] Fix | Delete
'[_date]',
[574] Fix | Delete
'[_serial_number]',
[575] Fix | Delete
'[_post_id]',
[576] Fix | Delete
'[_post_title]',
[577] Fix | Delete
'[_post_url]',
[578] Fix | Delete
'[_url]',
[579] Fix | Delete
'[_post_author]',
[580] Fix | Delete
'[_post_author_email]',
[581] Fix | Delete
'[_site_admin_email]',
[582] Fix | Delete
'[_user_login]',
[583] Fix | Delete
'[_user_email]',
[584] Fix | Delete
'[_user_first_name]',
[585] Fix | Delete
'[_user_last_name]',
[586] Fix | Delete
'[_user_nickname]',
[587] Fix | Delete
'[_user_display_name]',
[588] Fix | Delete
],
[589] Fix | Delete
[
[590] Fix | Delete
'{user_ip}',
[591] Fix | Delete
'{date format="m/d/Y"}',
[592] Fix | Delete
'{entry_id}',
[593] Fix | Delete
'{page_id}',
[594] Fix | Delete
'{page_title}',
[595] Fix | Delete
'{page_url}',
[596] Fix | Delete
'{page_url}',
[597] Fix | Delete
'{author_display}',
[598] Fix | Delete
'{author_email}',
[599] Fix | Delete
'{admin_email}',
[600] Fix | Delete
'{user_display}',
[601] Fix | Delete
'{user_email}',
[602] Fix | Delete
'{user_first_name}',
[603] Fix | Delete
'{user_last_name}',
[604] Fix | Delete
'{user_display}',
[605] Fix | Delete
'{user_full_name}',
[606] Fix | Delete
],
[607] Fix | Delete
$string
[608] Fix | Delete
);
[609] Fix | Delete
[610] Fix | Delete
// Replace those CF7 that are used in Notifications by default and that we can't leave empty.
[611] Fix | Delete
$string = str_replace(
[612] Fix | Delete
[
[613] Fix | Delete
'[_site_title]',
[614] Fix | Delete
'[_site_description]',
[615] Fix | Delete
'[_site_url]',
[616] Fix | Delete
],
[617] Fix | Delete
[
[618] Fix | Delete
get_bloginfo( 'name' ),
[619] Fix | Delete
get_bloginfo( 'description' ),
[620] Fix | Delete
get_bloginfo( 'url' ),
[621] Fix | Delete
],
[622] Fix | Delete
$string
[623] Fix | Delete
);
[624] Fix | Delete
[625] Fix | Delete
/*
[626] Fix | Delete
* We are not replacing certain special CF7 tags: [_user_url], [_post_name], [_time], [_user_agent].
[627] Fix | Delete
* Without them some logic may be broken and for user it will be harder to stop missing strings.
[628] Fix | Delete
* With them - they can see strange text and will be able to understand, based on the tag name, which value is expected there.
[629] Fix | Delete
*/
[630] Fix | Delete
[631] Fix | Delete
return $string;
[632] Fix | Delete
}
[633] Fix | Delete
[634] Fix | Delete
/**
[635] Fix | Delete
* Find Reply-To in headers if provided.
[636] Fix | Delete
*
[637] Fix | Delete
* @since 1.6.6
[638] Fix | Delete
*
[639] Fix | Delete
* @param string $headers CF7 email headers.
[640] Fix | Delete
* @param array $fields List of fields.
[641] Fix | Delete
*
[642] Fix | Delete
* @return string
[643] Fix | Delete
*/
[644] Fix | Delete
public function get_replyto( $headers, $fields ) {
[645] Fix | Delete
[646] Fix | Delete
if ( strpos( $headers, 'Reply-To:' ) !== false ) {
[647] Fix | Delete
preg_match( '/Reply-To: \[(.+?)\]/', $headers, $tag );
[648] Fix | Delete
[649] Fix | Delete
if ( ! empty( $tag[1] ) ) {
[650] Fix | Delete
foreach ( $fields as $field ) {
[651] Fix | Delete
if ( ! empty( $field['cf7_name'] ) && $field['cf7_name'] === $tag[1] ) {
[652] Fix | Delete
return '{field_id="' . $field['id'] . '"}';
[653] Fix | Delete
}
[654] Fix | Delete
}
[655] Fix | Delete
}
[656] Fix | Delete
}
[657] Fix | Delete
[658] Fix | Delete
return '';
[659] Fix | Delete
}
[660] Fix | Delete
[661] Fix | Delete
/**
[662] Fix | Delete
* Sender information.
[663] Fix | Delete
*
[664] Fix | Delete
* @since 1.6.6
[665] Fix | Delete
*
[666] Fix | Delete
* @param string $sender Sender strings in "Name <email@example.com>" format.
[667] Fix | Delete
* @param array $fields List of fields.
[668] Fix | Delete
*
[669] Fix | Delete
* @return bool|array
[670] Fix | Delete
*/
[671] Fix | Delete
public function get_sender_details( $sender, $fields ) {
[672] Fix | Delete
[673] Fix | Delete
preg_match( '/(.+?)\<(.+?)\>/', $sender, $tag );
[674] Fix | Delete
[675] Fix | Delete
if ( ! empty( $tag[1] ) && ! empty( $tag[2] ) ) {
[676] Fix | Delete
return [
[677] Fix | Delete
'name' => $this->get_smarttags( $tag[1], $fields ),
[678] Fix | Delete
'address' => $this->get_smarttags( $tag[2], $fields ),
[679] Fix | Delete
];
[680] Fix | Delete
}
[681] Fix | Delete
[682] Fix | Delete
return false;
[683] Fix | Delete
}
[684] Fix | Delete
}
[685] Fix | Delete
[686] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function