Commit 9eaf59e2 authored by Kevin Stover's avatar Kevin Stover

Merge branch 'release/v2.8.9'

parents 8547b895 e11091ca
......@@ -4,7 +4,7 @@
Tags: form, forms, contact form, custom form, form builder, form creator, form manager, form creation, contact forms, custom forms, forms builder, forms creator, forms manager, forms creation, form administration,
Requires at least: 3.8
Tested up to: 4.0
Stable tag: 2.8.8
Stable tag: 2.8.9
License: GPLv2 or later
Forms created with a simple drag and drop interface. Contact forms, Email collection forms, or any other form you want on your WordPress site.
......
......@@ -453,7 +453,7 @@ class NF_Subs_CPT {
$user_value = Ninja_Forms()->sub( $sub_id )->get_field( $field_id );
$args['field_id'] = $field_id;
$args['user_value'] = $user_value;
$args['user_value'] = htmlentities($user_value);
$args['field'] = $field;
call_user_func_array( $edit_value_function, $args );
......
......@@ -124,7 +124,8 @@ class NF_Convert_Notifications extends NF_Step_Processing {
}
// Create a notification for our admin email
if ( isset ( $form_settings['admin_mailto'] ) && ! empty ( $form_settings['admin_mailto'] ) ) {
if ( isset ( $form_settings['admin_email_msg'] ) && ! empty ( $form_settings['admin_email_msg'] ) ) {
// Create a notification
$n_id = nf_insert_notification( $form_id );
......@@ -137,8 +138,10 @@ class NF_Convert_Notifications extends NF_Step_Processing {
// Update our notification name
Ninja_Forms()->notification( $n_id )->update_setting( 'name', __( 'Admin Email', 'ninja-forms' ) );
$admin_mailto = isset ( $form_settings['admin_mailto'] ) ? $form_settings['admin_mailto'] : array();
// Implode our admin email addresses
$to = implode('`', $form_settings['admin_mailto'] );
$to = implode('`', $admin_mailto );
// Update our to setting
Ninja_Forms()->notification( $n_id )->update_setting( 'to', $to );
......
......@@ -16,9 +16,9 @@ function ninja_forms_display_fields($form_id){
if ( is_array ( $field_results ) AND !empty ( $field_results ) ) {
foreach ( $field_results as $field ) {
if ( isset ( $ninja_forms_loading ) ) {
if ( isset ( $ninja_forms_loading ) && $ninja_forms_loading->get_form_ID() == $form_id ) {
$field = $ninja_forms_loading->get_field_settings( $field['id'] );
} else if ( isset ( $ninja_forms_processing ) ) {
} else if ( isset ( $ninja_forms_processing ) && $ninja_forms_processing->get_form_ID() == $form_id ) {
$field = $ninja_forms_processing->get_field_settings( $field['id'] );
}
......@@ -95,7 +95,7 @@ function ninja_forms_display_fields($form_id){
//Check to see if display_wrap has been disabled. If it hasn't, show the wrapping DIV.
if($display_wrap){
$field_wrap_class = ninja_forms_get_field_wrap_class($field_id);
$field_wrap_class = ninja_forms_get_field_wrap_class($field_id, $form_id);
$field_wrap_class = apply_filters( 'ninja_forms_field_wrap_class', $field_wrap_class, $field_id );
do_action( 'ninja_forms_display_before_opening_field_wrap', $field_id, $data );
?>
......@@ -119,6 +119,7 @@ function ninja_forms_display_fields($form_id){
do_action( 'ninja_forms_display_before_field_function', $field_id, $data );
$arguments['field_id'] = $field_id;
$arguments['data'] = $data;
$arguments['form_id'] = $form_id;
call_user_func_array($display_function, $arguments);
do_action( 'ninja_forms_display_after_field_function', $field_id, $data );
if( $label_pos == 'left' OR $label_pos == 'inside'){
......@@ -155,12 +156,18 @@ function ninja_forms_display_fields($form_id){
*
**/
function ninja_forms_get_field_wrap_class($field_id){
function ninja_forms_get_field_wrap_class( $field_id, $form_id = '' ){
global $ninja_forms_loading, $ninja_forms_processing;
$field_wrap_class = 'field-wrap';
if ( isset ( $ninja_forms_loading ) ) {
if ( '' == $form_id ) {
$field = ninja_forms_get_field_by_id( $field_id );
$form_id = $field['form_id'];
}
if ( isset ( $ninja_forms_loading ) && $ninja_forms_loading->get_form_ID() == $form_id ) {
$field_row = $ninja_forms_loading->get_field_settings( $field_id );
} else {
} else if ( isset ( $ninja_forms_processing ) && $ninja_forms_processing->get_form_ID() == $form_id ) {
$field_row = $ninja_forms_processing->get_field_settings( $field_id );
}
......@@ -214,23 +221,26 @@ function ninja_forms_get_field_wrap_class($field_id){
}
function ninja_forms_get_field_class( $field_id ) {
function ninja_forms_get_field_class( $field_id, $form_id = '' ) {
global $ninja_forms_loading, $ninja_forms_processing;
if ( isset ( $ninja_forms_loading ) ) {
if ( '' == $form_id ) {
$field = ninja_forms_get_field_by_id( $field_id );
$form_id = $field['form_id'];
}
if ( isset ( $ninja_forms_loading ) && $ninja_forms_loading->get_form_ID() == $form_id ) {
$field_row = $ninja_forms_loading->get_field_settings( $field_id );
} else {
$field_class = $ninja_forms_loading->get_field_setting( $field_id, 'field_class' );
} else if ( isset ( $ninja_forms_processing ) && $ninja_forms_processing->get_form_ID() == $form_id ) {
$field_row = $ninja_forms_processing->get_field_settings( $field_id );
$field_class = $ninja_forms_processing->get_field_setting( $field_id, 'field_class' );
}
$field_data = $field_row['data'];
$field_data = apply_filters( 'ninja_forms_field', $field_data, $field_id );
if ( isset ( $ninja_forms_loading ) ) {
$field_class = $ninja_forms_loading->get_field_setting( $field_id, 'field_class' );
} else {
$field_class = $ninja_forms_processing->get_field_setting( $field_id, 'field_class' );
}
$field_type = isset ( $field_row['type'] ) ? $field_row['type'] : '';
$x = 0;
$custom_class = '';
......@@ -251,8 +261,6 @@ function ninja_forms_get_field_class( $field_id ) {
$req_class = 'ninja-forms-req';
}
$form_id = $field_row['form_id'];
// Check to see if we are dealing with a field that has the user_info_field_group set.
if ( isset ( $field_data['user_info_field_group_name'] ) and $field_data['user_info_field_group_name'] != '' ) {
$user_info_group_class = $field_data['user_info_field_group_name'].'-address';
......@@ -282,7 +290,7 @@ function ninja_forms_get_field_class( $field_id ) {
$address_class = 'address zip';
}
if ( '_country' == $field_row['type'] ) {
if ( '_country' == $field_type ) {
$address_class = 'address country';
}
......
......@@ -10,9 +10,12 @@ function ninja_forms_register_display_field_type(){
function ninja_forms_display_field_type( $field_id, $data ){
global $ninja_forms_loading, $ninja_forms_processing;
if ( isset ( $ninja_forms_loading ) ) {
$field = ninja_forms_get_field_by_id( $field_id );
$form_id = $field['form_id'];
if ( isset ( $ninja_forms_loading ) && $ninja_forms_loading->get_form_ID() == $form_id ) {
$field_row = $ninja_forms_loading->get_field_settings( $field_id );
} else if ( isset ( $ninja_forms_processing ) ) {
} else if ( isset ( $ninja_forms_processing ) && $ninja_forms_processing->get_form_ID() == $form_id ) {
$field_row = $ninja_forms_processing->get_field_settings( $field_id );
}
......
......@@ -7,11 +7,14 @@
function ninja_forms_display_field_label( $field_id, $data ){
global $ninja_forms_fields, $ninja_forms_loading, $ninja_forms_processing;
$field = ninja_forms_get_field_by_id( $field_id );
$form_id = $field['form_id'];
$plugin_settings = nf_get_settings();
if ( isset ( $ninja_forms_loading ) ) {
if ( isset ( $ninja_forms_loading ) && $ninja_forms_loading->get_form_ID() == $form_id ) {
$field_row = $ninja_forms_loading->get_field_settings( $field_id );
} else if ( isset ( $ninja_forms_processing ) ) {
} else if ( isset ( $ninja_forms_processing ) && $ninja_forms_processing->get_form_ID() == $form_id ) {
$field_row = $ninja_forms_processing->get_field_settings( $field_id );
}
......
......@@ -311,7 +311,7 @@ function ninja_forms_field_calc_edit( $field_id, $data ) {
* @since 2.2.28
* @return void
*/
function ninja_forms_field_calc_display( $field_id, $data ){
function ninja_forms_field_calc_display( $field_id, $data, $form_id = '' ){
if ( isset( $data['default_value'] ) ) {
$default_value = $data['default_value'];
......@@ -347,7 +347,7 @@ function ninja_forms_field_calc_display( $field_id, $data ){
$calc_method = '';
}
$field_class = ninja_forms_get_field_class( $field_id );
$field_class = ninja_forms_get_field_class( $field_id, $form_id );
?>
<input type="hidden" name="ninja_forms_field_<?php echo $field_id;?>" value="<?php echo $default_value;?>" class="<?php echo $field_class;?>">
......
......@@ -81,9 +81,9 @@ function ninja_forms_register_field_checkbox(){
add_action('init', 'ninja_forms_register_field_checkbox');
//Checkbox Display Function
function ninja_forms_field_checkbox_display($field_id, $data){
function ninja_forms_field_checkbox_display( $field_id, $data, $form_id = '' ){
$field_class = ninja_forms_get_field_class($field_id);
$field_class = ninja_forms_get_field_class( $field_id, $form_id );
$default_value = $data['default_value'];
if($default_value == 'checked' OR $default_value == 1){
$checked = 'checked = "checked"';
......
......@@ -310,7 +310,7 @@ add_action( 'init', 'ninja_forms_register_field_country' );
* @returns void
*/
function ninja_forms_field_country_display( $field_id, $data ) {
function ninja_forms_field_country_display( $field_id, $data, $form_id = '' ) {
$countries = array(
__( 'Afghanistan', 'ninja-forms' ) => 'AF',
__( 'Albania', 'ninja-forms' ) => 'AL',
......@@ -571,7 +571,7 @@ function ninja_forms_field_country_display( $field_id, $data ) {
$countries = array_merge( array( $country_custom_first => '' ), $countries );
}
$field_class = ninja_forms_get_field_class( $field_id );
$field_class = ninja_forms_get_field_class( $field_id, $form_id );
?>
<input type="hidden" id="ninja_forms_field_<?php echo $field_id;?>_list_type" value="dropdown">
......
......@@ -127,7 +127,7 @@ add_action( 'init', 'ninja_forms_register_field_credit_card' );
* @returns void
*/
function ninja_forms_field_credit_card_display( $field_id, $data ) {
function ninja_forms_field_credit_card_display( $field_id, $data, $form_id = '' ) {
global $ninja_forms_processing;
if( isset( $data['default_value'] ) ) {
......@@ -177,7 +177,7 @@ function ninja_forms_field_credit_card_display( $field_id, $data ) {
$card_year_errors = '';
}
$field_class = ninja_forms_get_field_class( $field_id );
$field_class = ninja_forms_get_field_class( $field_id, $form_id );
$post_field = apply_filters( 'ninja_forms_post_credit_card_field', false );
$desc_pos = apply_filters( 'ninja_forms_credit_card_field_desc_pos', 'after_label' );
$hide_cc_fields = apply_filters( 'ninja_forms_hide_cc_field', array() );
......
......@@ -52,7 +52,7 @@ function ninja_forms_register_field_desc(){
add_action('init', 'ninja_forms_register_field_desc');
function ninja_forms_field_desc_display( $field_id, $data ){
function ninja_forms_field_desc_display( $field_id, $data, $form_id = '' ){
if(isset($data['desc_el'])){
$desc_el = $data['desc_el'];
......@@ -80,7 +80,7 @@ function ninja_forms_field_desc_display( $field_id, $data ){
$display_style = '';
}
$default_value = do_shortcode( $default_value );
$field_class = ninja_forms_get_field_class($field_id);
$field_class = ninja_forms_get_field_class( $field_id, $form_id );
?>
<<?php echo $desc_el;?> class="<?php echo $field_class;?>" id="ninja_forms_field_<?php echo $field_id;?>_div_wrap" style="<?php echo $display_style;?>" rel="<?php echo $field_id;?>"><?php echo $default_value;?></<?php echo $desc_el;?>>
<?php
......
......@@ -116,10 +116,10 @@ function ninja_forms_field_hidden_edit($field_id, $data){
<?php
}
function ninja_forms_field_hidden_display($field_id, $data){
function ninja_forms_field_hidden_display( $field_id, $data, $form_id = '' ){
global $current_user;
$field_class = ninja_forms_get_field_class($field_id);
$field_class = ninja_forms_get_field_class( $field_id, $form_id );
if(isset($data['default_value'])){
$default_value = $data['default_value'];
}else{
......
......@@ -36,9 +36,9 @@ add_action('init', 'ninja_forms_register_field_honeypot');
function ninja_forms_field_honeypot_display($field_id, $data){
function ninja_forms_field_honeypot_display( $field_id, $data, $form_id = '' ){
$field_class = ninja_forms_get_field_class($field_id); ?>
$field_class = ninja_forms_get_field_class( $field_id, $form_id ); ?>
<input id="ninja_forms_field_<?php echo $field_id;?>" name="ninja_forms_field_<?php echo $field_id;?>" type="text" class="<?php echo $field_class;?>" value="" rel="<?php echo $field_id;?>" />
<?php
......
......@@ -23,14 +23,14 @@ function ninja_forms_register_field_hr(){
add_action('init', 'ninja_forms_register_field_hr');
function ninja_forms_field_hr_display($field_id, $data){
function ninja_forms_field_hr_display( $field_id, $data, $form_id = '' ){
if( isset( $data['display_style'] ) ){
$display_style = $data['display_style'];
}else{
$display_style = '';
}
$field_class = ninja_forms_get_field_class($field_id);
$field_class = ninja_forms_get_field_class( $field_id, $form_id );
?>
<hr class="<?php echo $field_class;?>" style="<?php echo $display_style;?>" id="ninja_forms_field_<?php echo $field_id;?>_div_wrap" rel="<?php echo $field_id;?>" />
<?php
......
......@@ -218,7 +218,7 @@ echo $example2;
<?php
}
function ninja_forms_field_list_display( $field_id, $data ){
function ninja_forms_field_list_display( $field_id, $data, $form_id = '' ){
global $wpdb, $ninja_forms_fields;
if(isset($data['show_field'])){
......@@ -227,7 +227,7 @@ function ninja_forms_field_list_display( $field_id, $data ){
$show_field = true;
}
$field_class = ninja_forms_get_field_class($field_id);
$field_class = ninja_forms_get_field_class( $field_id, $form_id );
$field_row = ninja_forms_get_field_by_id($field_id);
$type = $field_row['type'];
......
......@@ -89,7 +89,7 @@ function ninja_forms_field_number_edit( $field_id, $data ) {
<?php
}
function ninja_forms_field_number_display( $field_id, $data ) {
function ninja_forms_field_number_display( $field_id, $data, $form_id = '' ) {
if ( isset( $data['default_value'] ) ) {
$default_value = $data['default_value'];
} elseif( isset( $data['number_min'] ) ) {
......@@ -114,7 +114,7 @@ function ninja_forms_field_number_display( $field_id, $data ) {
$step = '';
}
$field_class = ninja_forms_get_field_class( $field_id );
$field_class = ninja_forms_get_field_class( $field_id, $form_id );
?>
<input type="number" <?php echo $min . $max . $step; ?>name="ninja_forms_field_<?php echo esc_attr( $field_id ); ?>" id="ninja_forms_field_<?php echo esc_attr( $field_id ); ?>" class="<?php echo esc_attr( $field_class ); ?>" rel="<?php echo esc_attr( $field_id ); ?>" value="<?php echo esc_attr( $default_value ); ?>"/>
......
......@@ -55,9 +55,9 @@ function ninja_forms_register_field_profile_pass(){
add_action( 'init', 'ninja_forms_register_field_profile_pass' );
function ninja_forms_field_profile_pass_display( $field_id, $data ){
function ninja_forms_field_profile_pass_display( $field_id, $data, $form_id = '' ){
global $current_user;
$field_class = ninja_forms_get_field_class( $field_id );
$field_class = ninja_forms_get_field_class( $field_id, $form_id );
if( isset( $data['default_value'] ) ){
$default_value = $data['default_value'];
......
......@@ -29,7 +29,7 @@ function ninja_forms_register_field_rating(){
add_action('init', 'ninja_forms_register_field_rating');
function ninja_forms_field_rating_display( $field_id, $data ){
function ninja_forms_field_rating_display( $field_id, $data, $form_id = '' ){
if( isset( $data['default_value'] ) ){
$default_value = $data['default_value'];
}else{
......
......@@ -46,7 +46,7 @@ function ninja_forms_register_field_spam(){
add_action('init', 'ninja_forms_register_field_spam');
function ninja_forms_field_spam_edit($field_id, $data){
function ninja_forms_field_spam_edit( $field_id, $data ){
if(isset($data['label'])){
$question = $data['label'];
}else{
......@@ -75,7 +75,7 @@ function ninja_forms_field_spam_edit($field_id, $data){
<?php
}
function ninja_forms_field_spam_display($field_id, $data){
function ninja_forms_field_spam_display( $field_id, $data, $form_id = '' ){
if(isset($data['default_value'])){
$default_value = $data['default_value'];
}else{
......@@ -88,7 +88,7 @@ function ninja_forms_field_spam_display($field_id, $data){
$show_field = true;
}
$field_class = ninja_forms_get_field_class($field_id);
$field_class = ninja_forms_get_field_class( $field_id, $form_id );
if(isset($data['label_pos'])){
$label_pos = $data['label_pos'];
}else{
......
......@@ -27,7 +27,7 @@ function ninja_forms_register_field_submit(){
add_action('init', 'ninja_forms_register_field_submit');
function ninja_forms_field_submit_display($field_id, $data){
function ninja_forms_field_submit_display( $field_id, $data, $form_id = '' ){
global $ninja_forms_loading, $ninja_forms_processing;
if ( isset ( $ninja_forms_loading ) ) {
......@@ -42,7 +42,7 @@ function ninja_forms_field_submit_display($field_id, $data){
$show_field = true;
}
$field_class = ninja_forms_get_field_class($field_id);
$field_class = ninja_forms_get_field_class( $field_id, $form_id );
if(isset($data['label']) AND $data['label'] != ''){
$label = $data['label'];
}else{
......
......@@ -48,14 +48,14 @@ add_action( 'init', 'ninja_forms_register_field_tax' );
* @returns void
*/
function ninja_forms_field_tax_display( $field_id, $data ) {
function ninja_forms_field_tax_display( $field_id, $data, $form_id = '' ) {
if(isset($data['default_value'])){
$default_value = $data['default_value'];
}else{
$default_value = '';
}
$field_class = ninja_forms_get_field_class( $field_id );
$field_class = ninja_forms_get_field_class( $field_id, $form_id );
?>
<input id="ninja_forms_field_<?php echo $field_id;?>" name="ninja_forms_field_<?php echo $field_id;?>" type="hidden" value="<?php echo $default_value;?>">
<input id="ninja_forms_field_<?php echo $field_id;?>" name="ninja_forms_field_<?php echo $field_id;?>" type="text" class="<?php echo $field_class;?>" value="<?php echo $default_value;?>" rel="<?php echo $field_id;?>" disabled/>
......
......@@ -52,7 +52,7 @@ function ninja_forms_register_field_textarea(){
add_action('init', 'ninja_forms_register_field_textarea');
function ninja_forms_field_textarea_display($field_id, $data){
function ninja_forms_field_textarea_display( $field_id, $data, $form_id = '' ){
if(isset($data['default_value'])){
$default_value = $data['default_value'];
}else{
......@@ -95,7 +95,7 @@ function ninja_forms_field_textarea_display($field_id, $data){
$input_limit_msg = '';
}
$field_class = ninja_forms_get_field_class( $field_id );
$field_class = ninja_forms_get_field_class( $field_id, $form_id );
if($textarea_rte == 1){
$settings = array( 'media_buttons' => $textarea_media );
......
......@@ -197,9 +197,9 @@ function ninja_forms_field_text_edit( $field_id, $data ){
<?php
}
function ninja_forms_field_text_display( $field_id, $data ){
function ninja_forms_field_text_display( $field_id, $data, $form_id = '' ){
global $current_user;
$field_class = ninja_forms_get_field_class( $field_id );
$field_class = ninja_forms_get_field_class( $field_id, $form_id );
if ( isset( $data['email'] ) && $data['email'] == 1 ) {
$field_class .= ' email';
......
......@@ -59,9 +59,9 @@ add_action('init', 'ninja_forms_register_field_timed_submit');
function ninja_forms_field_timed_submit_display($field_id, $data){
function ninja_forms_field_timed_submit_display( $field_id, $data, $form_id = '' ){
$field_class = ninja_forms_get_field_class($field_id);
$field_class = ninja_forms_get_field_class( $field_id, $form_id );
if(isset($data['timer-text']) AND $data['timer-text'] != ''){
$label = $data['timer-text'];
......
......@@ -30,7 +30,7 @@ function ninja_forms_field_shortcode( $atts ){
} else {
$value = '';
}
return $value;
return esc_html( $value );
}
add_shortcode( 'ninja_forms_field', 'ninja_forms_field_shortcode' );
......
......@@ -3,7 +3,7 @@
Plugin Name: Ninja Forms
Plugin URI: http://ninjaforms.com/
Description: Ninja Forms is a webform builder with unparalleled ease of use and features.
Version: 2.8.8
Version: 2.8.9
Author: The WP Ninjas
Author URI: http://ninjaforms.com
Text Domain: ninja-forms
......@@ -263,7 +263,7 @@ class Ninja_Forms {
// Plugin version
if ( ! defined( 'NF_PLUGIN_VERSION' ) )
define( 'NF_PLUGIN_VERSION', '2.8.8' );
define( 'NF_PLUGIN_VERSION', '2.8.9' );
// Plugin Folder Path
if ( ! defined( 'NF_PLUGIN_DIR' ) )
......
......@@ -3,7 +3,7 @@ Contributors: kstover, jameslaws, wpnzach, daveshine, mordauk, bftrick, helgathe
Tags: form, forms, contact form, custom form, form builder, form creator, form manager, form creation, contact forms, custom forms, forms builder, forms creator, forms manager, forms creation, form administration,
Requires at least: 3.8
Tested up to: 4.0
Stable tag: 2.8.8
Stable tag: 2.8.9
License: GPLv2 or later
Forms created with a simple drag and drop interface. Contact forms, Email collection forms, or any other form you want on your WordPress site.
......@@ -74,17 +74,16 @@ For help and video tutorials, please visit our website: [Ninja Forms Documentati
== Upgrade Notice ==
= 2.8.8 (17 November 2014 ) =
= 2.8.9 (20 November 2014 ) =
*Changes:*
*Security Update:*
* Credit card field labels and descriptions can now be edited on the field settings tab.
* This version includes a fix to a security vulnerability. Please take the time to update to this version.
*Bugs:*
* Fixed a bug with importing the initial contact form.
* BCC and CC fields should now send to multiple addresses properly.
* Fixed several instances where strings weren't internationalized properly.
* Fixed a bug with conversions from older versions of Ninja Forms.
* Fixed a bug that could cause two forms on the same page to behave improperly.
== Requested Features ==
......@@ -92,6 +91,17 @@ If you have any feature requests, please feel free to visit [ninjaforms.com](htt
== Changelog ==
= 2.8.9 (20 November 2014 ) =
*Security Update:*
* This version includes a fix to a security vulnerability. Please take the time to update to this version.
*Bugs:*
* Fixed a bug with conversions from older versions of Ninja Forms.
* Fixed a bug that could cause two forms on the same page to behave improperly.
= 2.8.8 (17 November 2014 ) =
*Changes:*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment