Changeset 1522463
- Timestamp:
- 10/26/2016 12:43:19 PM (9 years ago)
- Location:
- wp-libre-form
- Files:
-
- 9 edited
- 2 copied
-
tags/1.1.1 (copied) (copied from wp-libre-form/trunk)
-
tags/1.1.1/classes/class-cpt-wplf-submission.php (modified) (1 diff)
-
tags/1.1.2 (copied) (copied from wp-libre-form/trunk)
-
tags/1.1.2/classes/class-cpt-wplf-submission.php (modified) (1 diff)
-
tags/1.1.2/inc/wplf-form-validation.php (modified) (2 diffs)
-
tags/1.1.2/readme.txt (modified) (1 diff)
-
tags/1.1.2/wp-libre-form.php (modified) (2 diffs)
-
trunk/classes/class-cpt-wplf-submission.php (modified) (1 diff)
-
trunk/inc/wplf-form-validation.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/wp-libre-form.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-libre-form/tags/1.1.1/classes/class-cpt-wplf-submission.php
r1522426 r1522463 207 207 $attachment_suffix = '_attachment'; 208 208 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' ); 210 210 $possible_link = '<a target="_blank" href="' . get_edit_post_link( $value ) . '" style="float:right">' . $link_text . '</a>'; 211 211 } -
wp-libre-form/tags/1.1.2/classes/class-cpt-wplf-submission.php
r1522426 r1522463 207 207 $attachment_suffix = '_attachment'; 208 208 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' ); 210 210 $possible_link = '<a target="_blank" href="' . get_edit_post_link( $value ) . '" style="float:right">' . $link_text . '</a>'; 211 211 } -
wp-libre-form/tags/1.1.2/inc/wplf-form-validation.php
r1359097 r1522463 31 31 // get required fields from form 32 32 $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 33 35 $fields_empty = array(); 34 36 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 36 43 $fields_empty[] = $key; 37 44 } … … 39 46 $fields_empty = array_filter( $fields_empty ); // get rid of the empty keys 40 47 41 if( ! empty( $fields_empty ) ) { 48 $return->debug = $_FILES; 49 50 if(! empty( $fields_empty ) ) { 42 51 $return->ok = 0; 43 52 $return->error = __('Required fields are missing.', 'wp-libre-form'); -
wp-libre-form/tags/1.1.2/readme.txt
r1522426 r1522463 5 5 Requires at least: 4.2 6 6 Tested up to: 4.6.1 7 Stable tag: 1.1. 17 Stable tag: 1.1.2 8 8 License: GPLv3 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html -
wp-libre-form/tags/1.1.2/wp-libre-form.php
r1522426 r1522463 4 4 * Plugin URI: https://github.com/anttiviljami/wp-libre-form 5 5 * Description: A minimal HTML form builder for WordPress; made for developers 6 * Version: 1.1. 16 * Version: 1.1.2 7 7 * Author: @anttiviljami 8 8 * Author URI: https://github.com/anttiviljami/ … … 32 32 if ( ! class_exists( 'WP_Libre_Form' ) ) : 33 33 34 define( 'WPLF_VERSION', '1.1. 1' );34 define( 'WPLF_VERSION', '1.1.2' ); 35 35 36 36 class WP_Libre_Form { -
wp-libre-form/trunk/classes/class-cpt-wplf-submission.php
r1522426 r1522463 207 207 $attachment_suffix = '_attachment'; 208 208 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' ); 210 210 $possible_link = '<a target="_blank" href="' . get_edit_post_link( $value ) . '" style="float:right">' . $link_text . '</a>'; 211 211 } -
wp-libre-form/trunk/inc/wplf-form-validation.php
r1359097 r1522463 31 31 // get required fields from form 32 32 $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 33 35 $fields_empty = array(); 34 36 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 36 43 $fields_empty[] = $key; 37 44 } … … 39 46 $fields_empty = array_filter( $fields_empty ); // get rid of the empty keys 40 47 41 if( ! empty( $fields_empty ) ) { 48 $return->debug = $_FILES; 49 50 if(! empty( $fields_empty ) ) { 42 51 $return->ok = 0; 43 52 $return->error = __('Required fields are missing.', 'wp-libre-form'); -
wp-libre-form/trunk/readme.txt
r1522426 r1522463 5 5 Requires at least: 4.2 6 6 Tested up to: 4.6.1 7 Stable tag: 1.1. 17 Stable tag: 1.1.2 8 8 License: GPLv3 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html -
wp-libre-form/trunk/wp-libre-form.php
r1522426 r1522463 4 4 * Plugin URI: https://github.com/anttiviljami/wp-libre-form 5 5 * Description: A minimal HTML form builder for WordPress; made for developers 6 * Version: 1.1. 16 * Version: 1.1.2 7 7 * Author: @anttiviljami 8 8 * Author URI: https://github.com/anttiviljami/ … … 32 32 if ( ! class_exists( 'WP_Libre_Form' ) ) : 33 33 34 define( 'WPLF_VERSION', '1.1. 1' );34 define( 'WPLF_VERSION', '1.1.2' ); 35 35 36 36 class WP_Libre_Form {
Note: See TracChangeset
for help on using the changeset viewer.