PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.22
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.22
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
← All changes | classes/models/FrmEmail.php +7 -24 6.266.22 View file →
@@ -236,9 +236,8 @@
236 236 *
237 237 * @since 2.03.04
238 238 *
239 239 * @param array $user_id_args
240 - *
241 240 * @return void
242 241 */
243 242 private function set_from( $user_id_args ) {
244 243 if ( empty( $this->settings['from'] ) ) {
@@ -281,15 +280,11 @@
281 280 *
282 281 * @return void
283 282 */
284 283 private function set_is_plain_text() {
285 - if ( empty( $this->settings['email_style'] ) ) {
286 - // If `email_style` isn't set, use the `plain_text` checkbox.
287 - $this->is_plain_text = ! empty( $this->settings['plain_text'] );
288 - return;
284 + if ( $this->settings['plain_text'] ) {
285 + $this->is_plain_text = true;
289 286 }
290 -
291 - $this->is_plain_text = 'plain' === $this->settings['email_style'];
292 287 }
293 288
294 289 /**
295 290 * Set the include_user_info property
@@ -402,13 +397,12 @@
402 397 $pass_entry = clone $this->entry;
403 398 $mail_body = FrmEntriesHelper::replace_default_message(
404 399 $prev_mail_body,
405 400 array(
406 - 'id' => $this->entry->id,
407 - 'entry' => $pass_entry,
408 - 'plain_text' => $this->is_plain_text,
409 - 'user_info' => $this->include_user_info,
410 - 'table_style' => $this->settings['email_style'],
401 + 'id' => $this->entry->id,
402 + 'entry' => $pass_entry,
403 + 'plain_text' => $this->is_plain_text,
404 + 'user_info' => $this->include_user_info,
411 405 )
412 406 );
413 407
414 408 // Add the user info if it isn't already included
@@ -438,10 +432,9 @@
438 432 * @return void
439 433 */
440 434 private function add_autop() {
441 435 $message = $this->message;
442 - preg_match( '/<body[^>]*>([\s\S]*?)<\/body>/', $message, $match );
443 -
436 + $result = preg_match( '/<body[^>]*>([\s\S]*?)<\/body>/', $message, $match );
444 437 if ( ! empty( $match[1] ) ) {
445 438 $this->message = str_replace( $match[1], trim( wpautop( $match[1] ) ), $message );
446 439 } else {
447 440 $this->message = trim( wpautop( $message ) );
@@ -534,9 +527,8 @@
534 527 $this->remove_buddypress_filters();
535 528 $this->add_mandrill_filter();
536 529
537 530 $sent = false;
538 -
539 531 if ( count( $this->to ) > 1 && $this->is_single_recipient ) {
540 532 foreach ( $this->to as $recipient ) {
541 533 $sent = $this->send_single( $recipient );
542 534 }
@@ -575,9 +567,8 @@
575 567 if ( ! $sent ) {
576 568 if ( is_array( $header ) ) {
577 569 $header = implode( "\r\n", $header );
578 570 }
579 -
580 571 $recipient = implode( ',', (array) $recipient );
581 572 $sent = mail( $recipient, $subject, $this->message, $header );
582 573 }
583 574
@@ -626,9 +617,8 @@
626 617 'field_key' => '',
627 618 );
628 619
629 620 $user_id_args['field_id'] = FrmEmailHelper::get_user_id_field_for_form( $form_id );
630 -
631 621 if ( $user_id_args['field_id'] ) {
632 622 $user_id_args['field_key'] = FrmField::get_key_by_id( $user_id_args['field_id'] );
633 623 }
634 624
@@ -672,9 +662,8 @@
672 662 * @return array|string $emails
673 663 */
674 664 private function explode_emails( $emails ) {
675 665 $emails = ( ! empty( $emails ) ? preg_split( '/(,|;)/', $emails ) : '' );
676 -
677 666 if ( is_array( $emails ) ) {
678 667 $emails = array_map( 'trim', $emails );
679 668 } else {
680 669 $emails = trim( $emails );
@@ -743,9 +732,8 @@
743 732 if ( strpos( $from_email, '@yahoo.com' ) ) {
744 733
745 734 // Get the site domain and get rid of www.
746 735 $sitename = strtolower( FrmAppHelper::get_server_value( 'SERVER_NAME' ) );
747 -
748 736 if ( substr( $sitename, 0, 4 ) === 'www.' ) {
749 737 $sitename = substr( $sitename, 4 );
750 738 }
751 739
@@ -785,9 +773,8 @@
785 773 * @return string
786 774 */
787 775 private function get_email_from_name( $name ) {
788 776 $email = trim( trim( $name, '>' ), '<' );
789 -
790 777 if ( strpos( $email, '<' ) !== false ) {
791 778 $parts = explode( '<', $email );
792 779 $email = trim( $parts[1], '>' );
793 780 }
@@ -823,10 +810,8 @@
823 810 * @since 3.0.06
824 811 *
825 812 * @param string $name
826 813 * @param string $email
827 - *
828 - * @return string
829 814 */
830 815 private function format_from_email( $name, $email ) {
831 816 if ( '' !== $name ) {
832 817 $email = $name . ' <' . $email . '>';
@@ -891,12 +876,10 @@
891 876 'subject' => $this->subject,
892 877 'message' => $this->message,
893 878 'attachments' => $this->attachments,
894 879 'plain_text' => $this->is_plain_text,
895 - 'email_key' => $this->email_key,
896 880 'form' => $this->form,
897 881 'entry' => $this->entry,
898 - 'email_style' => $this->settings['email_style'],
899 882 );
900 883 }
901 884
902 885 /**