Skip to content

Commit 9c25ab5

Browse files
committed
Updated from 1.8.16 to 1.8.18.
1 parent dfaaaf5 commit 9c25ab5

15 files changed

+2367
-2100
lines changed

change_log.txt

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,56 @@
1+
-------------------------------------------------------------------------------------------------------------------
2+
Version 1.8.18
3+
4+
- Added filters on entry detail to support editing payment related data in the payment info box.
5+
- Added the parameter name as a third parameter to the "gform_field_value" filter.
6+
- Added "gform_entry_detail_grid_display_empty_fields" filter to allow displaying empty fields even if option is not checked (i.e. print view).
7+
add_filter( 'gform_entry_detail_grid_display_empty_fields', '__return_true' );
8+
- Added filter to get_form_meta() to allow forms to be filtered globally.
9+
- Updated localization of certain strings.
10+
- Updated POT file.
11+
- Updated the order of marking an entry as spam so that it is done before the gform_entry_created and gform_entry_post_save hooks.
12+
13+
- Fixed issue with PayPal fulfillment not going through when entry was marked as Paid in the entry detail page.
14+
- Fixed issue with trial period amount (fixed amount entered on subscription feed) for currencies other than Dollar.
15+
- Fixed issue with Chrome on Android for drop downs with conditional logic.
16+
- Fixed an issue with the field filters on the entry list, export entries and results pages where product fields couldn't be filtered.
17+
- Fixed issue with complex fields not being properly loaded into array.
18+
- Fixed issue where List fields in notifications sometimes displayed incorrectly due to max line size being exceeded.
19+
- Fixed issue with quantity fields not defaulting to correct value after being hidden by conditional logic.
20+
- Fixed an issue with the single file upload field where validation fails if the max file size is set higher than 2047MB.
21+
22+
- AF: Added check to framework to prevent sending spam entries to non-payment feeds. This will take effect in feeds as they are migrated to the Add-On Framework.
23+
- AF: Fixed issue with feeds not getting executed when configured for delayed payment and the payment amount ends up being $0.00.
24+
- AF: Fixed issue with feed addons not preserving current feed when a new feed was getting created.
25+
26+
-------------------------------------------------------------------------------------------------------------------
27+
Version 1.8.17
28+
- Added form specific version of 'gform_entry_is_spam' filter.
29+
- Added "gform_entry_is_spam" filter.
30+
add_filter( 'gform_entry_is_spam', 'it_is_all_spam', 10, 3 );
31+
function it_is_all_spam( $is_spam, $form, $entry ) {
32+
return true;
33+
}
34+
- Updated entry list and detail pages to display spam features if gform_entry_is_spam hook is used when Akismet integration is disabled.
35+
- Updated is_duplicate check to work for "long" values as well.
36+
- Added 'gform_disable_view_counter' filter to disable counting of form views. Both globally and by form id. Views column remains displayed on the Forms page.
37+
add_filter( 'gform_disable_view_counter', '__return_true' );
38+
add_filter( 'gform_disable_view_counter_12', '__return_false' );
39+
- Fixed XSS vulnerability.
40+
- Fixed a notice on the WordPress updates page.
41+
- Fixed issue with Add-On manager displaying error when installing Add-Ons.
42+
- Fixed notice when $form['pagination']['display_progressbar_on_confirmation'] was not set.
43+
- Fixed issue with entry list page payment status drop down containing "Approved" instead of "Paid".
44+
- Fixed issue where setting an input-based field value to empty would fail to save.
45+
- AF: Added get_feeds_by_slug function.
46+
- AF: Added is_delayed function to check whether a feed is delayed processing with PayPal Standard.
47+
- AF: Updated maybe_process_feed function to handle processing when add-on is set as delayed in PayPal Standard feed setup.
48+
- AF: Updated logging statements to be clearer.
49+
- AF: Removed unused function get_feed_by_entry.
50+
151
-------------------------------------------------------------------------------------------------------------------
252
Version 1.8.16
53+
354
- Fixed some strings that weren't localized and added localization context to others
455
- Fixed issue with datepicker to prevent user being returned to start of form when tabbing after selecting a date.
556
- Fixed a notice on the WordPress updates page
@@ -9,11 +60,13 @@ Version 1.8.16
960

1061
-------------------------------------------------------------------------------------------------------------------
1162
Version 1.8.15
63+
1264
- Fixed an issue with the multi-file upload field while uploading multiple files all selected at the same time in the file dialog. If one of the uploads fails due to an HTTP error then the next file in the list will appear as 100% complete but it will be removed from the form submission.
1365
- AF: Fixed issue with checkboxes no retaining their values
1466

1567
-------------------------------------------------------------------------------------------------------------------
1668
Version 1.8.14
69+
1770
- Fixed a potential security vulnerability for some servers which could allow code to be parsed via the file upload field.
1871
- Fixed a security issue to prevent code injection
1972
- Fixed an issue with the file upload field that allows malicious form submissions to bypass the validation for the maximum file size setting.
@@ -23,6 +76,7 @@ Version 1.8.14
2376

2477
-------------------------------------------------------------------------------------------------------------------
2578
Version 1.8.13
79+
2680
- Added additional check plus user feedback for failed multi-file uploads.
2781
- Fixed a potential security vulnerability for some server configurations which could allow code to be executed via the file upload field.
2882
- Fixed issue with form export/import setting inactive notifications to active.
@@ -37,6 +91,7 @@ Version 1.8.13
3791

3892
-------------------------------------------------------------------------------------------------------------------
3993
Version 1.8.12
94+
4095
- Added PHP version of the "gform_calculation_result" filter.
4196
add_filter( 'gform_calculation_result', 'my_calc_result', 10, 5 );
4297
function my_calc_result( $result, $formula, $field, $form, $entry ) {
@@ -139,6 +194,7 @@ Version 1.8.10
139194

140195
-------------------------------------------------------------------------------------------------------------------
141196
Version 1.8.9
197+
142198
- Added "password" to the list of fields which allow HTML input.
143199
- Added 'gform_field_container' filter to allow modifying the field container markup.
144200
add_action( 'gform_field_container', 'my_field_container', 10, 6 );
@@ -396,6 +452,7 @@ Version 1.8.5
396452

397453
-------------------------------------------------------------------------------------------------------------------
398454
Version 1.8.4.1
455+
399456
- Fixed issue with tooltips not working on Add On pages. Included font-awesome.css to Add On pages to fix the issue.
400457
- Fixed issue where old inputs were not removed when adding new choices via bulk add functionality for Post Custom Fields with a "checkbox" field type
401458
- Fixed an issue with entry export which may result in an empty export file for forms with a large number of entries
@@ -470,6 +527,7 @@ Version 1.8.4
470527

471528
-------------------------------------------------------------------------------------------------------------------
472529
Version 1.8.3
530+
473531
- Added new filter "gform_post_category_choices" to alter post category choices sort order. Both globally and form id + field id specific.
474532
add_filter("gform_post_category_choices", "set_sort", 10, 3);
475533
function set_sort($choices, $field, $form_id){

common.php

Lines changed: 43 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3700,7 +3700,11 @@ public static function get_field_input($field, $value="", $lead_id=0, $form_id=0
37003700
$upload .= sprintf('<input type="hidden" name="input_%d" value=\'%s\' />', $id, esc_attr($value));
37013701

37023702
} else {
3703-
$upload = sprintf("<input type='hidden' name='MAX_FILE_SIZE' value='%d' />", $max_upload_size);
3703+
$upload = '';
3704+
if ( $max_upload_size <= 2047 * 1048576 ) {
3705+
// MAX_FILE_SIZE > 2048MB fails. The file size is checked anyway once uploaded, so it's not necessary.
3706+
$upload = sprintf( "<input type='hidden' name='MAX_FILE_SIZE' value='%d' />", $max_upload_size );
3707+
}
37043708
$upload .= sprintf("<input name='input_%d' id='%s' type='file' class='%s' $tabindex %s/>", $id, $field_id, esc_attr($class), $disabled_text);
37053709
}
37063710

@@ -4695,48 +4699,48 @@ public static function get_lead_field_display($field, $value, $currency="", $use
46954699

46964700
default :
46974701
if($media == "email"){
4698-
$list = "<table class='gfield_list' style='border-top: 1px solid #DFDFDF; border-left: 1px solid #DFDFDF; border-spacing: 0; padding: 0; margin: 2px 0 6px; width: 100%'><thead><tr>";
4702+
$list = "<table class='gfield_list' style='border-top: 1px solid #DFDFDF; border-left: 1px solid #DFDFDF; border-spacing: 0; padding: 0; margin: 2px 0 6px; width: 100%'><thead><tr>\n";
46994703

47004704
//reading columns from entry data
47014705
foreach($columns as $column){
4702-
$list .= "<th style='background-image: none; border-right: 1px solid #DFDFDF; border-bottom: 1px solid #DFDFDF; padding: 6px 10px; font-family: sans-serif; font-size: 12px; font-weight: bold; background-color: #F1F1F1; color:#333; text-align:left'>" . esc_html($column) . "</th>";
4706+
$list .= "<th style='background-image: none; border-right: 1px solid #DFDFDF; border-bottom: 1px solid #DFDFDF; padding: 6px 10px; font-family: sans-serif; font-size: 12px; font-weight: bold; background-color: #F1F1F1; color:#333; text-align:left'>" . esc_html($column) . "</th>\n";
47034707
}
4704-
$list .= "</tr></thead>";
4708+
$list .= "</tr></thead>\n";
47054709

47064710
$list .= "<tbody style='background-color: #F9F9F9'>";
47074711
foreach($value as $item){
47084712
$list .= "<tr>";
47094713
foreach($columns as $column){
47104714
$val = rgar($item, $column);
4711-
$list .= "<td style='padding: 6px 10px; border-right: 1px solid #DFDFDF; border-bottom: 1px solid #DFDFDF; border-top: 1px solid #FFF; font-family: sans-serif; font-size:12px;'>{$val}</td>";
4715+
$list .= "<td style='padding: 6px 10px; border-right: 1px solid #DFDFDF; border-bottom: 1px solid #DFDFDF; border-top: 1px solid #FFF; font-family: sans-serif; font-size:12px;'>{$val}</td>\n";
47124716
}
47134717

4714-
$list .="</tr>";
4718+
$list .="</tr>\n";
47154719
}
47164720

4717-
$list .="<tbody></table>";
4721+
$list .="<tbody></table>\n";
47184722
}
47194723
else{
4720-
$list = "<table class='gfield_list'><thead><tr>";
4724+
$list = "<table class='gfield_list'><thead><tr>\n";
47214725

47224726
//reading columns from entry data
47234727
foreach($columns as $column){
4724-
$list .= "<th>" . esc_html($column) . "</th>";
4728+
$list .= "<th>" . esc_html($column) . "</th>\n";
47254729
}
4726-
$list .= "</tr></thead>";
4730+
$list .= "</tr></thead>\n";
47274731

47284732
$list .= "<tbody>";
47294733
foreach($value as $item){
47304734
$list .= "<tr>";
47314735
foreach($columns as $column){
47324736
$val = rgar($item, $column);
4733-
$list .= "<td>{$val}</td>";
4737+
$list .= "<td>{$val}</td>\n";
47344738
}
47354739

4736-
$list .="</tr>";
4740+
$list .="</tr>\n";
47374741
}
47384742

4739-
$list .="<tbody></table>";
4743+
$list .="<tbody></table>\n";
47404744
}
47414745
break;
47424746
}
@@ -4921,6 +4925,12 @@ public static function gform_do_shortcode($content){
49214925
return do_shortcode($content);
49224926
}
49234927

4928+
public static function spam_enabled( $form_id ) {
4929+
$spam_enabled = self::akismet_enabled( $form_id ) || has_filter( 'gform_entry_is_spam' ) || has_filter( "gform_entry_is_spam_{$form_id}" );
4930+
4931+
return $spam_enabled;
4932+
}
4933+
49244934
public static function has_akismet(){
49254935
$akismet_exists = function_exists('akismet_http_post') || function_exists('Akismet::http_post');
49264936
return $akismet_exists;
@@ -5638,11 +5648,17 @@ public static function get_field_filter_settings($form) {
56385648

56395649
foreach ($fields as $field) {
56405650

5651+
$input_type = GFFormsModel::get_input_type( $field );
5652+
56415653
$field_type = GFFormsModel::get_input_type($field);
56425654

56435655
$operators = isset($operators_by_field_type[$field_type]) ? $operators_by_field_type[$field_type] : $operators_by_field_type["default"];
5644-
if (!isset($field["choices"]) && !in_array("contains", $operators))
5645-
$operators[] = "contains";
5656+
5657+
if ( $field['type'] == 'product' && in_array( $input_type, array( 'radio', 'select' ) ) ) {
5658+
$operators = array( 'is' );
5659+
} elseif (!isset($field["choices"]) && !in_array("contains", $operators)){
5660+
$operators[] = "contains";
5661+
}
56465662

56475663
$field_filter = array();
56485664
$key = $field["id"];
@@ -5764,8 +5780,8 @@ public static function get_entry_info_filter_columns($get_users = true){
57645780
"operators" => array( "is", "isnot"),
57655781
"values" => array(
57665782
array(
5767-
"text" => "Approved",
5768-
"value" => "Approved"
5783+
"text" => "Paid",
5784+
"value" => "Paid"
57695785
),
57705786
array(
57715787
"text" => "Failed",
@@ -5825,7 +5841,7 @@ public static function get_entry_meta_filter_settings($form_id) {
58255841
}
58265842

58275843

5828-
public static function get_field_filters_from_post(){
5844+
public static function get_field_filters_from_post($form){
58295845
$field_filters = array();
58305846
$filter_fields = rgpost("f");
58315847
if (is_array($filter_fields)) {
@@ -5846,6 +5862,15 @@ public static function get_field_filters_from_post(){
58465862
$val = $key_array[1] . ":" . $val;
58475863
}
58485864
$field_filter["key"] = $key;
5865+
5866+
$field = GFFormsModel::get_field( $form, $key );
5867+
if ( $field ) {
5868+
$input_type = GFFormsModel::get_input_type( $field );
5869+
if ( $field['type'] == 'product' && in_array( $input_type, array( 'radio', 'select' ) ) ) {
5870+
$operator = 'contains';
5871+
}
5872+
}
5873+
58495874
$field_filter["operator"] = $operator;
58505875
$field_filter["value"] = $val;
58515876
$field_filters[] = $field_filter;

0 commit comments

Comments
 (0)