at path:
ROOT
/
wp-content
/
plugins
/
contact-form-7
/
includes
/
mail-tag.php
run:
R
W
Run
block-editor
DIR
2026-02-08 11:50:05
R
W
Run
config-validator
DIR
2026-02-08 11:50:05
R
W
Run
css
DIR
2026-02-08 11:50:05
R
W
Run
js
DIR
2026-02-08 11:50:05
R
W
Run
swv
DIR
2026-02-08 11:50:06
R
W
Run
capabilities.php
834 By
2026-02-08 11:50:05
R
W
Run
Delete
Rename
contact-form-functions.php
10.26 KB
2026-02-08 11:50:05
R
W
Run
Delete
Rename
contact-form-template.php
5.64 KB
2026-02-08 11:50:05
R
W
Run
Delete
Rename
contact-form.php
30.74 KB
2026-02-08 11:50:05
R
W
Run
Delete
Rename
controller.php
3.16 KB
2026-02-08 11:50:05
R
W
Run
Delete
Rename
file.php
10.13 KB
2026-02-08 11:50:05
R
W
Run
Delete
Rename
filesystem.php
3 KB
2026-02-08 11:50:05
R
W
Run
Delete
Rename
form-tag.php
14.29 KB
2026-02-08 11:50:05
R
W
Run
Delete
Rename
form-tags-manager.php
14.57 KB
2026-02-08 11:50:05
R
W
Run
Delete
Rename
formatting.php
14.47 KB
2026-02-08 11:50:05
R
W
Run
Delete
Rename
functions.php
16.98 KB
2026-02-08 11:50:05
R
W
Run
Delete
Rename
html-formatter.php
20.66 KB
2026-02-08 11:50:05
R
W
Run
Delete
Rename
integration.php
8.76 KB
2026-02-08 11:50:05
R
W
Run
Delete
Rename
l10n.php
3.37 KB
2026-02-08 11:50:05
R
W
Run
Delete
Rename
mail-tag.php
4.1 KB
2026-02-08 11:50:05
R
W
Run
Delete
Rename
mail.php
15.15 KB
2026-02-08 11:50:05
R
W
Run
Delete
Rename
pipe.php
2.62 KB
2026-02-08 11:50:05
R
W
Run
Delete
Rename
pocket-holder.php
325 By
2026-02-08 11:50:05
R
W
Run
Delete
Rename
rest-api.php
12.99 KB
2026-02-08 11:50:05
R
W
Run
Delete
Rename
shortcodes.php
2.66 KB
2026-02-08 11:50:05
R
W
Run
Delete
Rename
special-mail-tags.php
6.53 KB
2026-02-08 11:50:05
R
W
Run
Delete
Rename
submission.php
20.23 KB
2026-02-08 11:50:05
R
W
Run
Delete
Rename
upgrade.php
3.1 KB
2026-02-08 11:50:06
R
W
Run
Delete
Rename
validation-functions.php
6.67 KB
2026-02-08 11:50:06
R
W
Run
Delete
Rename
validation.php
3.26 KB
2026-02-08 11:50:06
R
W
Run
Delete
Rename
error_log
up
📄
mail-tag.php
Save
<?php /** * Class that represents a mail-tag. */ class WPCF7_MailTag { private $tag; private $tagname = ''; private $name = ''; private $options = array(); private $values = array(); private $form_tag = null; /** * The constructor method. */ public function __construct( $tag, $tagname, $values ) { $this->tag = $tag; $this->name = $this->tagname = $tagname; $this->options = array( 'do_not_heat' => false, 'format' => '', ); if ( ! empty( $values ) ) { preg_match_all( '/"[^"]*"|\'[^\']*\'/', $values, $matches ); $this->values = wpcf7_strip_quote_deep( $matches[0] ); } if ( preg_match( '/^_raw_(.+)$/', $tagname, $matches ) ) { $this->name = trim( $matches[1] ); $this->options['do_not_heat'] = true; } if ( preg_match( '/^_format_(.+)$/', $tagname, $matches ) ) { $this->name = trim( $matches[1] ); $this->options['format'] = $this->values[0]; } } /** * Returns the name part of this mail-tag. */ public function tag_name() { return $this->tagname; } /** * Returns the form field name corresponding to this mail-tag. */ public function field_name() { return strtr( $this->name, '.', '_' ); } /** * Returns the value of the specified option. */ public function get_option( $option ) { return $this->options[$option]; } /** * Returns the values part of this mail-tag. */ public function values() { return $this->values; } /** * Retrieves the WPCF7_FormTag object that corresponds to this mail-tag. */ public function corresponding_form_tag() { if ( $this->form_tag instanceof WPCF7_FormTag ) { return $this->form_tag; } if ( $submission = WPCF7_Submission::get_instance() ) { $contact_form = $submission->get_contact_form(); $tags = $contact_form->scan_form_tags( array( 'name' => $this->field_name(), 'feature' => '! zero-controls-container', ) ); if ( $tags ) { $this->form_tag = $tags[0]; } } return $this->form_tag; } } use Contactable\SWV; /** * Mail-tag output calculator. */ class WPCF7_MailTag_OutputCalculator { const email = 0b100; const text = 0b010; const blank = 0b001; private $contact_form; public function __construct( WPCF7_ContactForm $contact_form ) { $this->contact_form = $contact_form; } public function calc_output( WPCF7_MailTag $mail_tag ) { return $this->calc_swv_result( $mail_tag, $this->contact_form->get_schema() ); } private function calc_swv_result( WPCF7_MailTag $mail_tag, SWV\Rule $rule ) { if ( $rule instanceof SWV\AnyRule ) { $result = 0b000; foreach ( $rule->rules() as $child_rule ) { $result |= $this->calc_swv_result( $mail_tag, $child_rule ); } return $result; } if ( $rule instanceof SWV\CompositeRule ) { $result = 0b111; foreach ( $rule->rules() as $child_rule ) { $result &= $this->calc_swv_result( $mail_tag, $child_rule ); } return $result; } $field_prop = $rule->get_property( 'field' ); if ( empty( $field_prop ) or $field_prop !== $mail_tag->field_name() ) { return self::email | self::text | self::blank; } if ( $rule instanceof SWV\RequiredRule ) { return ~ self::blank; } if ( $rule instanceof SWV\EmailRule ) { return self::email | self::blank; } if ( $rule instanceof SWV\EnumRule ) { $acceptable_values = (array) $rule->get_property( 'accept' ); $acceptable_values = array_map( 'strval', $acceptable_values ); $acceptable_values = array_filter( $acceptable_values ); $acceptable_values = array_unique( $acceptable_values ); if ( ! $mail_tag->get_option( 'do_not_heat' ) ) { $pipes = $this->contact_form->get_pipes( $mail_tag->field_name() ); $acceptable_values = array_map( static function ( $val ) use ( $pipes ) { return $pipes->do_pipe( $val ); }, $acceptable_values ); } $email_values = array_filter( $acceptable_values, 'wpcf7_is_mailbox_list' ); if ( count( $email_values ) === count( $acceptable_values ) ) { return self::email | self::blank; } else { return self::email | self::text | self::blank; } } return self::email | self::text | self::blank; } }