Plugin Directory

Changeset 1324135


Ignore:
Timestamp:
01/08/2016 06:18:58 PM (10 years ago)
Author:
Jebble
Message:

fix: changed check for empty attachment array that caused AJAX processed forms to hang

Location:
gf-uploads-as-attachments/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • gf-uploads-as-attachments/trunk/gforms-uploads-as-attachments.php

    r1322952 r1324135  
    109109            }
    110110
    111             if ( empty( $url ) ) {
    112                 continue;
    113             }
    114             elseif ( $field['multipleFiles'] ) {
    115                 $uploaded_files = json_decode( stripslashes( $url ), true );
    116                 foreach ( $uploaded_files as $uploaded_file ) {
    117                     $attachment = preg_replace( '|^(.*?)/gravity_forms/|', $upload_root, $uploaded_file );
    118                     $attachments[] = $attachment;
    119                 }
    120             } else {
    121                 $attachment = preg_replace( '|^(.*?)/gravity_forms/|', $upload_root, $url );
    122                 $attachments[] = $attachment;
    123             }
     111            if ( ! empty( $url ) ) {
     112                if ( $field['multipleFiles'] ) {
     113                    $uploaded_files = json_decode( stripslashes( $url ), true );
     114                    foreach ( $uploaded_files as $uploaded_file ) {
     115                        $attachment = preg_replace( '|^(.*?)/gravity_forms/|', $upload_root, $uploaded_file );
     116                        $attachments[] = $attachment;
     117                    }
     118                } else {
     119                    $attachment = preg_replace( '|^(.*?)/gravity_forms/|', $upload_root, $url );
     120                    $attachments[] = $attachment;
     121                }
     122            }
    124123
    125124            $notification['attachments'] = $attachments;
  • gf-uploads-as-attachments/trunk/readme.txt

    r1322959 r1324135  
    77License: GPLv2 or later.
    88
    9 Adds the option to add all fileupload fields to notifications as attachments
     9Adds the option to add all fileupload fields no notifications as attachments
    1010
    1111== Description ==
     
    4040
    4141== Changelog ==
     42
     43#####1.0.1
     44- Fix for hanging AJAX processed forms.
     45
    4246#####1.0.0
    4347Initial release
Note: See TracChangeset for help on using the changeset viewer.