' . esc_html__( 'Form already exists', 'contact-forms') . '
'; } elseif (empty($forms_data[$clonefrom])) { $error .= '' . esc_html__( 'Source form doesn\'t exists.', 'contact-forms') . '
'; } else { $forms_data[$fid] = $forms_data[$clonefrom]; if (!isset($forms_data[$fid]['title'])) { $forms_data[$fid]['title'] = $clonefrom ." ".__( 'clone', 'contact-forms'); } else { $forms_data[$fid]['title'] .= " ". __( 'clone', 'contact-forms'); } update_option('accua_forms_saved_forms', $forms_data); } } return $error; } // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound -- Internal helper function, underscore prefix indicates private function _accua_forms_form_edit_action() { static $message = null; if ($message === null) { $message = ''; if (isset($_POST['accua-form-edit-action'])){ $post = stripslashes_deep($_POST); switch ($post['accua-form-edit-action']) { case 'delete': $fid = isset($post['form-id']) ? $post['form-id'] : ''; check_admin_referer('contact-forms-delete_'.$fid); $forms_data = get_option('accua_forms_saved_forms', array()); unset($forms_data[$fid]); update_option('accua_forms_saved_forms', $forms_data); $fid = esc_html($fid); // translators: %s is the form ID being deleted $message .= sprintf( __( 'Form "%s" deleted','contact-forms' ), $fid ); break; } } } return $message; } function accua_forms_validate_form_id($fid) { // Cast before the string checks below: a request that omits form-id // reaches here with null, and preg_match()/substr()/strlen() have // deprecated null arguments since PHP 8.1. An empty id fails the // pattern check anyway, which is the answer the callers want. $fid = (string) $fid; $error = ''; if (!preg_match('/^[a-z0-9_-]+$/i', $fid)) { $error .= "".__( 'Only letters, numbers, hyphens, and underscores allowed in form identifier', 'contact-forms')."
"; } if (substr($fid,0,2) == '__') { $error .= "".__( 'The identifier cannot start with two underscores (__)', 'contact-forms')."
"; } if (strlen($fid) > 70) { $error .= "".__( 'The identifier cannot be longer than 70 characters', 'contact-forms')."
"; } return $error; } function accua_forms_list_page() { $message = ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing -- Nonce verified below if (isset($_POST['accua-form-edit-action'])){ $message = _accua_forms_form_edit_action(); } elseif (isset($_GET['fid'])) { check_admin_referer('edit_posts'); $fid = sanitize_text_field(wp_unslash($_GET['fid'])); $error = accua_forms_validate_form_id($fid); // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Nonce verified above if ($error === '' && (isset($_GET['clonefrom']) && $_GET['clonefrom'] !== '')) { $error .= _accua_forms_test_clonefrom($fid); } if ($error === '') { return accua_forms_edit_page($fid); } else { return accua_forms_add_page($error); } } ?>/>
|
(es: AW-123456789/aaBBccDD) |
|
/>
' . esc_html($default_form_data['admin_emails_to']) . '' ); ?> |
|
|
/>
' . esc_html($default_form_data['emails_bcc']) . '' ); ?> |
|
|
/>
' . esc_html($default_form_data['admin_emails_subject']) . '' ); ?> |
|
/>
' . esc_html($default_form_data['emails_from_name']) . '' ); ?> |
|
|
/>
' . esc_html($default_form_data['emails_from']) . '' ); ?> |
|
|
/>
' . esc_html($default_form_data['confirmation_emails_subject']) . '' ); ?> |
|
/>
' . esc_html( $global_summary ) . '' ); ?> |