PluginProbe
weForms – Easy Drag & Drop Contact Form Builder For WordPress / 1.6.17
weForms – Easy Drag & Drop Contact Form Builder For WordPress v1.6.17
1.6.7 1.6.8 1.6.9 1.6.12 1.6.13 1.6.14 1.6.15 1.6.16 1.6.17 1.6.18 1.6.19 1.6.2 1.6.20 1.6.21 1.6.22 1.6.23 1.6.24 1.6.25 1.6.26 1.6.27 1.6.28 1.6.3 1.6.4 1.6.5 1.6.6 All 74 releases
← All changes | includes/class-notification.php +11 -5 1.6.281.6.17 View file →
@@ -429,9 +429,9 @@
429 429 return get_permalink( $this->args['page_id'] );
430 430 break;
431 431
432 432 case 'url_referer':
433 - return isset( $_SERVER['HTTP_REFERER'] ) ? sanitize_url( wp_unslash( $_SERVER['HTTP_REFERER'] ) ) : '';
433 + return isset( $_SERVER['HTTP_REFERER'] ) ? sanitize_text_field( wp_unslash( $_SERVER['HTTP_REFERER'] ) ) : '';
434 434 break;
435 435
436 436 case 'url_login':
437 437 return wp_login_url();
@@ -601,9 +601,8 @@
601 601 *
602 602 * @return string
603 603 */
604 604 public static function replace_file_tags( $text, $entry_id ) {
605 - $text = $text ?? '';
606 605 $pattern = '/{(?:image|file):(\w*)}/';
607 606
608 607 preg_match_all( $pattern, $text, $matches );
609 608
@@ -614,12 +613,19 @@
614 613
615 614 foreach ( $matches[1] as $index => $meta_key ) {
616 615 $meta_value = weforms_get_entry_meta( $entry_id, $meta_key, true );
617 616
618 - $files = [];
619 - $attachments = is_array( $meta_value ) ? $meta_value : array( $meta_value );
617 + $files = [];
620 618
621 - foreach ( $attachments as $attachment_id ) {
619 + if ( is_array( $meta_value ) ) {
620 + foreach ( $meta_value as $key => $attachment_id ) {
621 + $file_url = wp_get_attachment_url( $attachment_id );
622 +
623 + if ( $file_url ) {
624 + $files[] = $file_url;
625 + }
626 + }
627 + } else {
622 628 $file_url = wp_get_attachment_url( $attachment_id );
623 629
624 630 if ( $file_url ) {
625 631 $files[] = $file_url;