Plugin Directory

Changeset 1522463


Ignore:
Timestamp:
10/26/2016 12:43:19 PM (9 years ago)
Author:
Zuige
Message:

Tagging 1.1.2

Location:
wp-libre-form
Files:
9 edited
2 copied

Legend:

Unmodified
Added
Removed
  • wp-libre-form/tags/1.1.1/classes/class-cpt-wplf-submission.php

    r1522426 r1522463  
    207207        $attachment_suffix = '_attachment';
    208208        if ( substr( $field, -strlen( $attachment_suffix ) ) === $attachment_suffix && wp_get_attachment_url( $value ) ) {
    209           $link_text = __( 'View Attachment' );
     209          $link_text = __( 'View Attachment', 'wp-libre-form' );
    210210          $possible_link = '<a target="_blank" href="' . get_edit_post_link( $value ) . '" style="float:right">' . $link_text . '</a>';
    211211        }
  • wp-libre-form/tags/1.1.2/classes/class-cpt-wplf-submission.php

    r1522426 r1522463  
    207207        $attachment_suffix = '_attachment';
    208208        if ( substr( $field, -strlen( $attachment_suffix ) ) === $attachment_suffix && wp_get_attachment_url( $value ) ) {
    209           $link_text = __( 'View Attachment' );
     209          $link_text = __( 'View Attachment', 'wp-libre-form' );
    210210          $possible_link = '<a target="_blank" href="' . get_edit_post_link( $value ) . '" style="float:right">' . $link_text . '</a>';
    211211        }
  • wp-libre-form/tags/1.1.2/inc/wplf-form-validation.php

    r1359097 r1522463  
    3131  // get required fields from form
    3232  $required = explode( ',', get_post_meta( $_POST['_form_id'], '_wplf_required', true ) );
     33
     34  // make sure required form fields are submitted within $_POST or $_FILES arrays
    3335  $fields_empty = array();
    3436  foreach( $required as $key ) {
    35     if( ! array_key_exists( $key, $_POST ) || empty( $_POST[$key] ) ) {
     37    if(
     38      ( !array_key_exists( $key, $_POST ) && !array_key_exists( $key, $_FILES ) ) ||
     39      ( empty( $_POST[$key] ) && ! ( $_FILES[$key]['size'] > 0 ) )
     40    ) {
     41      // required field wasn't in $_POST or $_FILES
     42      // we also don't accept files that are 0 bytes long
    3643      $fields_empty[] = $key;
    3744    }
     
    3946  $fields_empty = array_filter( $fields_empty ); // get rid of the empty keys
    4047
    41   if( ! empty( $fields_empty ) ) {
     48  $return->debug = $_FILES;
     49
     50  if(! empty( $fields_empty ) ) {
    4251    $return->ok = 0;
    4352    $return->error = __('Required fields are missing.', 'wp-libre-form');
  • wp-libre-form/tags/1.1.2/readme.txt

    r1522426 r1522463  
    55Requires at least: 4.2
    66Tested up to: 4.6.1
    7 Stable tag: 1.1.1
     7Stable tag: 1.1.2
    88License: GPLv3
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
  • wp-libre-form/tags/1.1.2/wp-libre-form.php

    r1522426 r1522463  
    44 * Plugin URI: https://github.com/anttiviljami/wp-libre-form
    55 * Description: A minimal HTML form builder for WordPress; made for developers
    6  * Version: 1.1.1
     6 * Version: 1.1.2
    77 * Author: @anttiviljami
    88 * Author URI: https://github.com/anttiviljami/
     
    3232if ( ! class_exists( 'WP_Libre_Form' ) ) :
    3333
    34 define( 'WPLF_VERSION', '1.1.1' );
     34define( 'WPLF_VERSION', '1.1.2' );
    3535
    3636class WP_Libre_Form {
  • wp-libre-form/trunk/classes/class-cpt-wplf-submission.php

    r1522426 r1522463  
    207207        $attachment_suffix = '_attachment';
    208208        if ( substr( $field, -strlen( $attachment_suffix ) ) === $attachment_suffix && wp_get_attachment_url( $value ) ) {
    209           $link_text = __( 'View Attachment' );
     209          $link_text = __( 'View Attachment', 'wp-libre-form' );
    210210          $possible_link = '<a target="_blank" href="' . get_edit_post_link( $value ) . '" style="float:right">' . $link_text . '</a>';
    211211        }
  • wp-libre-form/trunk/inc/wplf-form-validation.php

    r1359097 r1522463  
    3131  // get required fields from form
    3232  $required = explode( ',', get_post_meta( $_POST['_form_id'], '_wplf_required', true ) );
     33
     34  // make sure required form fields are submitted within $_POST or $_FILES arrays
    3335  $fields_empty = array();
    3436  foreach( $required as $key ) {
    35     if( ! array_key_exists( $key, $_POST ) || empty( $_POST[$key] ) ) {
     37    if(
     38      ( !array_key_exists( $key, $_POST ) && !array_key_exists( $key, $_FILES ) ) ||
     39      ( empty( $_POST[$key] ) && ! ( $_FILES[$key]['size'] > 0 ) )
     40    ) {
     41      // required field wasn't in $_POST or $_FILES
     42      // we also don't accept files that are 0 bytes long
    3643      $fields_empty[] = $key;
    3744    }
     
    3946  $fields_empty = array_filter( $fields_empty ); // get rid of the empty keys
    4047
    41   if( ! empty( $fields_empty ) ) {
     48  $return->debug = $_FILES;
     49
     50  if(! empty( $fields_empty ) ) {
    4251    $return->ok = 0;
    4352    $return->error = __('Required fields are missing.', 'wp-libre-form');
  • wp-libre-form/trunk/readme.txt

    r1522426 r1522463  
    55Requires at least: 4.2
    66Tested up to: 4.6.1
    7 Stable tag: 1.1.1
     7Stable tag: 1.1.2
    88License: GPLv3
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
  • wp-libre-form/trunk/wp-libre-form.php

    r1522426 r1522463  
    44 * Plugin URI: https://github.com/anttiviljami/wp-libre-form
    55 * Description: A minimal HTML form builder for WordPress; made for developers
    6  * Version: 1.1.1
     6 * Version: 1.1.2
    77 * Author: @anttiviljami
    88 * Author URI: https://github.com/anttiviljami/
     
    3232if ( ! class_exists( 'WP_Libre_Form' ) ) :
    3333
    34 define( 'WPLF_VERSION', '1.1.1' );
     34define( 'WPLF_VERSION', '1.1.2' );
    3535
    3636class WP_Libre_Form {
Note: See TracChangeset for help on using the changeset viewer.