PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 5.5
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v5.5
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 +1 -67 6.5.35.5 View file →
@@ -141,10 +141,8 @@
141 141 *
142 142 * @since 2.03.04
143 143 *
144 144 * @param object $action
145 - *
146 - * @return void
147 145 */
148 146 private function set_email_key( $action ) {
149 147 $this->email_key = $action->ID;
150 148 }
@@ -154,10 +152,8 @@
154 152 *
155 153 * @since 2.03.04
156 154 *
157 155 * @param array $user_id_args
158 - *
159 - * @return void
160 156 */
161 157 private function set_to( $user_id_args ) {
162 158 $to = $this->prepare_email_setting( $this->settings['email_to'], $user_id_args );
163 159 $to = $this->explode_emails( $to );
@@ -190,10 +186,8 @@
190 186 *
191 187 * @since 2.03.04
192 188 *
193 189 * @param array $user_id_args
194 - *
195 - * @return void
196 190 */
197 191 private function set_cc( $user_id_args ) {
198 192 $this->cc = $this->prepare_additional_recipients( $this->settings['cc'], $user_id_args );
199 193 }
@@ -203,10 +197,8 @@
203 197 *
204 198 * @since 2.03.04
205 199 *
206 200 * @param array $user_id_args
207 - *
208 - * @return void
209 201 */
210 202 private function set_bcc( $user_id_args ) {
211 203 $this->bcc = $this->prepare_additional_recipients( $this->settings['bcc'], $user_id_args );
212 204 }
@@ -254,10 +246,8 @@
254 246 *
255 247 * @since 2.03.04
256 248 *
257 249 * @param array $user_id_args
258 - *
259 - * @return void
260 250 */
261 251 private function set_reply_to( $user_id_args ) {
262 252 $this->reply_to = trim( $this->settings['reply_to'] );
263 253
@@ -276,10 +266,8 @@
276 266 * Set the is_plain_text property
277 267 * This should be set before the message
278 268 *
279 269 * @since 2.03.04
280 - *
281 - * @return void
282 270 */
283 271 private function set_is_plain_text() {
284 272 if ( $this->settings['plain_text'] ) {
285 273 $this->is_plain_text = true;
@@ -290,10 +278,8 @@
290 278 * Set the include_user_info property
291 279 * This should be set before the message
292 280 *
293 281 * @since 2.03.04
294 - *
295 - * @return void
296 282 */
297 283 private function set_include_user_info() {
298 284 if ( isset( $this->settings['inc_user_info'] ) ) {
299 285 $this->include_user_info = $this->settings['inc_user_info'];
@@ -305,11 +291,8 @@
305 291 *
306 292 * @since 2.03.04
307 293 *
308 294 * @param $action
309 - * @param object $action
310 - *
311 - * @return void
312 295 */
313 296 private function set_is_single_recipient( $action ) {
314 297 $args = array(
315 298 'form' => $this->form,
@@ -328,10 +311,8 @@
328 311 /**
329 312 * Set the charset
330 313 *
331 314 * @since 2.03.04
332 - *
333 - * @return void
334 315 */
335 316 private function set_charset() {
336 317 $this->charset = get_option( 'blog_charset' );
337 318 }
@@ -339,10 +320,8 @@
339 320 /**
340 321 * Set the content type
341 322 *
342 323 * @since 2.03.04
343 - *
344 - * @return void
345 324 */
346 325 private function set_content_type() {
347 326 if ( $this->is_plain_text ) {
348 327 $this->content_type = 'text/plain';
@@ -379,20 +358,12 @@
379 358 /**
380 359 * Set the email message
381 360 *
382 361 * @since 2.03.04
383 - *
384 - * @return void
385 362 */
386 363 private function set_message() {
387 - $this->message = $this->settings['email_message'];
364 + $this->message = FrmFieldsHelper::basic_replace_shortcodes( $this->settings['email_message'], $this->form, $this->entry );
388 365
389 - if ( ! $this->is_plain_text ) {
390 - $this->message = html_entity_decode( $this->message ); // The decode is to support [default-html] shortcodes.
391 - }
392 -
393 - $this->message = FrmFieldsHelper::basic_replace_shortcodes( $this->message, $this->form, $this->entry );
394 -
395 366 $prev_mail_body = $this->message;
396 367 $pass_entry = clone $this->entry; // make a copy to prevent changes by reference
397 368 $mail_body = FrmEntriesHelper::replace_default_message(
398 369 $prev_mail_body,
@@ -418,35 +389,13 @@
418 389 $this->message = do_shortcode( $this->message );
419 390
420 391 if ( $this->is_plain_text ) {
421 392 $this->message = wp_specialchars_decode( strip_tags( $this->message ), ENT_QUOTES );
422 - } else {
423 - $this->add_autop();
424 393 }
425 394
426 395 $this->message = apply_filters( 'frm_email_message', $this->message, $this->package_atts() );
427 396 }
428 397
429 - /**
430 - * Runs message through autop, extracting the content inside body tag if it has <body>.
431 - *
432 - * @return void
433 - */
434 - private function add_autop() {
435 - $message = $this->message;
436 - $result = preg_match( '/<body[^>]*>([\s\S]*?)<\/body>/', $message, $match );
437 - if ( ! empty( $match[1] ) ) {
438 - $this->message = str_replace( $match[1], trim( wpautop( $match[1] ) ), $message );
439 - } else {
440 - $this->message = trim( wpautop( $message ) );
441 - }
442 - }
443 -
444 - /**
445 - * @param string $mail_body
446 - *
447 - * @return void
448 - */
449 398 private function maybe_add_ip( &$mail_body ) {
450 399 if ( ! empty( $this->entry->ip ) ) {
451 400 $mail_body .= __( 'IP Address', 'formidable' ) . ': ' . $this->entry->ip . "\r\n";
452 401 }
@@ -767,12 +716,8 @@
767 716 /**
768 717 * Get only the email if the name and email have been combined
769 718 *
770 719 * @since 3.0.06
771 - *
772 - * @param string $name
773 - *
774 - * @return string
775 720 */
776 721 private function get_email_from_name( $name ) {
777 722 $email = trim( trim( $name, '>' ), '<' );
778 723 if ( strpos( $email, '<' ) !== false ) {
@@ -808,11 +753,8 @@
808 753 }
809 754
810 755 /**
811 756 * @since 3.0.06
812 - *
813 - * @param string $name
814 - * @param string $email
815 757 */
816 758 private function format_from_email( $name, $email ) {
817 759 if ( '' !== $name ) {
818 760 $email = $name . ' <' . $email . '>';
@@ -825,10 +767,8 @@
825 767 * Remove phone numbers from To addresses
826 768 * Send the phone numbers to the frm_send_to_not_email hook
827 769 *
828 770 * @since 2.03.04
829 - *
830 - * @return void
831 771 */
832 772 private function handle_phone_numbers() {
833 773
834 774 foreach ( $this->to as $key => $recipient ) {
@@ -886,10 +826,8 @@
886 826 /**
887 827 * Remove the Buddypress email filters
888 828 *
889 829 * @since 2.03.04
890 - *
891 - * @return void
892 830 */
893 831 private function remove_buddypress_filters() {
894 832 remove_filter( 'wp_mail_from', 'bp_core_email_from_address_filter' );
895 833 remove_filter( 'wp_mail_from_name', 'bp_core_email_from_name_filter' );
@@ -899,10 +837,8 @@
899 837 * Add Mandrill line break filter
900 838 * Remove line breaks in HTML emails to prevent conflicts with Mandrill
901 839 *
902 840 * @since 2.03.04
903 - *
904 - * @return void
905 841 */
906 842 private function add_mandrill_filter() {
907 843 if ( ! $this->is_plain_text ) {
908 844 add_filter( 'mandrill_nl2br', 'FrmEmailHelper::remove_mandrill_br' );
@@ -912,10 +848,8 @@
912 848 /**
913 849 * Remove Mandrill line break filter
914 850 *
915 851 * @since 2.03.04
916 - *
917 - * @return void
918 852 */
919 853 private function remove_mandrill_filter() {
920 854 remove_filter( 'mandrill_nl2br', 'FrmEmailHelper::remove_mandrill_br' );
921 855 }